FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaExamples/AggregationDemo2.java at master · alimogh/JavaExamples · GitHub
alimogh
/
JavaExamples
Public
forked from
CMPundhir/JavaExamples
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaExamples
/
AggregationDemo2.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (37 loc) · 863 Bytes
Breadcrumbs
JavaExamples
/
AggregationDemo2.java
Copy path
File metadata and controls
37 lines (37 loc) · 863 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
34
35
36
37
class
Address
{
int
hNo
;
String
street
;
int
pincode
;
String
city
;
public
Address
(
int
hNo
,
String
street
,
int
pincode
,
String
city
){
this
.
hNo
=
hNo
;
this
.
street
=
street
;
this
.
pincode
=
pincode
;
this
.
city
=
city
;
}
@
Override
public
String
toString
(){
return
"Address{
\n
house no : "
+
hNo
+
",
\n
street : "
+
street
+
",
\n
pincode : "
+
pincode
+
",
\n
city : "
+
city
+
"}"
;
}
}
class
Student
{
int
rn
;
String
name
;
Address
addr
;
public
Student
(
int
rn
,
String
name
,
Address
addr
){
this
.
rn
=
rn
;
this
.
name
=
name
;
this
.
addr
=
addr
;
}
@
Override
public
String
toString
(){
return
"Student{
\n
roll no :"
+
rn
+
",
\n
name : "
+
name
+
",
\n
address : "
+
addr
+
"}"
;
}
}
class
AggregationDemo2
{
public
static
void
main
(
String
[]
args
){
Address
addr
=
new
Address
(
108
,
"A- Block"
,
110033
,
"Delhi"
);
Student
s
=
new
Student
(
1
,
"Tanishq"
,
addr
);
System
.
out
.
println
(
s
);
}
}
Back
|
FazBrowse Home
|
New Git URL