FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaProgramming/Employee.java at main · PrityKumari14/JavaProgramming · GitHub
PrityKumari14
/
JavaProgramming
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaProgramming
/
Employee.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (33 loc) · 871 Bytes
Breadcrumbs
JavaProgramming
/
Employee.java
Copy path
File metadata and controls
33 lines (33 loc) · 871 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import
java
.
util
.*;
// import java.util.Scanner;
public
class
Employee
{
public
String
name
;
public
int
age
;
// parameterized constructor
public
Employee
(
String
name
,
int
age
)
{
this
.
name
=
name
;
this
.
age
=
age
;
}
public
Employee
()
{
this
.
name
=
"William"
;
this
.
age
=
28
;
}
public
void
show
()
{
System
.
out
.
println
(
"Name of Employee:"
+
this
.
name
);
System
.
out
.
println
(
"Age of Employee:"
+
this
.
age
);
}
public
static
void
main
(
String
args
[])
{
Employee
e
=
new
Employee
();
Scanner
sc
=
new
Scanner
(
System
.
in
);
System
.
out
.
println
(
"Enter the name of Employee"
);
String
name
=
sc
.
nextLine
();
System
.
out
.
println
(
"Enter the Age: "
);
int
age
=
sc
.
nextInt
();
new
Employee
(
name
,
age
).
show
();
new
Employee
().
show
();
}
}
Back
|
FazBrowse Home
|
New Git URL