Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
ClassDemo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
a.guest
ClassDemo
Commits
1d96c957
Commit
1d96c957
authored
Oct 21, 2018
by
a.guest
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added name variable, getter and setter
parent
39947ec8
Pipeline
#150
failed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
ClassDemo.java
src/ClassDemo.java
+3
-0
HelloWorld.java
src/HelloWorld.java
+13
-0
No files found.
src/ClassDemo.java
View file @
1d96c957
...
...
@@ -9,6 +9,9 @@ public class ClassDemo {
System
.
out
.
println
(
"2 + 5 = "
+
hello
.
add2Num
(
2
,
5
));
System
.
out
.
println
(
"My name is "
+
hello
.
getName
());
hello
.
setName
(
"Andy"
);
System
.
out
.
println
(
"My name is "
+
hello
.
getName
());
}
}
src/HelloWorld.java
View file @
1d96c957
public
class
HelloWorld
{
String
name
=
"default name"
;
public
void
sayHello
()
{
System
.
out
.
println
(
"Hello World"
);
...
...
@@ -10,5 +12,16 @@ public class HelloWorld {
{
return
a
+
b
;
}
public
void
setName
(
String
newName
)
{
name
=
newName
;
}
public
String
getName
()
{
return
name
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment