Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Assignments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
Suresh Kumar
Assignments
Commits
5d0ac557
Commit
5d0ac557
authored
3 years ago
by
Suresh Kumar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'features/Encapsulation' into 'develop'
Refactor See merge request
!18
parents
dfd27677
d7a7742a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
4 additions
and
45 deletions
+4
-45
Department.class
.../Encapsulation/task1/multipleFileExample/Department.class
+0
-0
Employee.class
...on/Encapsulation/task1/multipleFileExample/Employee.class
+0
-0
Department.java
Encapsulation/src/task1/multipleFileExample/Department.java
+0
-2
Employee.java
Encapsulation/src/task1/multipleFileExample/Employee.java
+2
-2
Student.java
Encapsulation/src/task1/multipleFileExample/Student.java
+0
-2
Test.java
Encapsulation/src/task1/multipleFileExample/Test.java
+1
-28
Encap.java
Encapsulation/src/task1/singleFile/Encap.java
+1
-11
No files found.
Encapsulation/out/production/Encapsulation/task1/multipleFileExample/Department.class
View file @
5d0ac557
No preview for this file type
This diff is collapsed.
Click to expand it.
Encapsulation/out/production/Encapsulation/task1/multipleFileExample/Employee.class
View file @
5d0ac557
No preview for this file type
This diff is collapsed.
Click to expand it.
Encapsulation/src/task1/multipleFileExample/Department.java
View file @
5d0ac557
package
task1
.
multipleFileExample
;
//import java.util.*;
public
class
Department
{
private
int
id
;
private
String
name
;
...
...
This diff is collapsed.
Click to expand it.
Encapsulation/src/task1/multipleFileExample/Employee.java
View file @
5d0ac557
...
...
@@ -3,7 +3,7 @@ import java.util.*;
public
class
Employee
{
Scanner
sc
=
new
Scanner
(
System
.
in
);
private
Integer
id
;
private
int
id
;
private
String
name
;
private
String
department
;
...
...
@@ -13,7 +13,7 @@ public class Employee {
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
...
...
This diff is collapsed.
Click to expand it.
Encapsulation/src/task1/multipleFileExample/Student.java
View file @
5d0ac557
package
task1
.
multipleFileExample
;
import
java.util.*
;
public
class
Student
{
// Scanner in = new Scanner(System.in);
int
id
;
String
name
;
String
department
;
...
...
This diff is collapsed.
Click to expand it.
Encapsulation/src/task1/multipleFileExample/Test.java
View file @
5d0ac557
package
task1
.
multipleFileExample
;
import
java.util.*
;
public
class
Test
{
//Scanner in = new Scanner(System.in);
public
static
void
main
(
String
[]
args
){
Employee
e
=
new
Employee
();
/*ß
e.setId(153);
System.out.println("Your id Number is " +e.getId());
e.setName("Suresh Kumar");
System.out.println("Your Name is " + e.getName());
e.setDepartment("Information Technology");
System.out.println("Your Department is " + e.getDepartment());
e.setAddress("Akhtar Colony Karachi");
System.out.println("Your Address is " + e.getAddress());*/
Student
s
=
new
Student
();
s
.
id
=
153
;
System
.
out
.
println
(
"Your id Numbr is "
+
s
.
id
);
s
.
name
=
"Mr Suresh Kumar"
;
...
...
@@ -36,13 +16,6 @@ public class Test {
s
.
address
=
"Akhtar Colony Kerachi"
;
System
.
out
.
println
(
"Your name is "
+
s
.
address
);
System
.
out
.
println
(
"Task Completed "
);
}
}
This diff is collapsed.
Click to expand it.
Encapsulation/src/task1/singleFile/Encap.java
View file @
5d0ac557
...
...
@@ -2,9 +2,7 @@ package task1.singleFile;
import
java.util.*
;
public
class
Encap
{
Scanner
in
=
new
Scanner
(
System
.
in
);
private
String
name
=
in
.
nextLine
();
private
int
roll
=
in
.
nextInt
();
...
...
@@ -12,27 +10,19 @@ public class Encap {
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
public
void
setRoll
(
int
roll
)
{
this
.
roll
=
roll
;
}
public
int
getRoll
()
{
return
roll
;
}
public
static
void
main
(
String
[]
args
){
Encap
student
=
new
Encap
();
System
.
out
.
println
(
"Student Name = "
+
student
.
getName
()
);
System
.
out
.
println
(
"Student Roll Number "
+
student
.
getRoll
()
);
System
.
out
.
println
(
"Student Roll Number "
+
student
.
getRoll
()
);
}
}
This diff is collapsed.
Click to expand it.
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