-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.java
More file actions
40 lines (38 loc) · 815 Bytes
/
Copy pathStudent.java
File metadata and controls
40 lines (38 loc) · 815 Bytes
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
38
39
40
import java.util.*;
public class Student
{
private String name;
private int id;
private Address ad;
public Student(){
name = "Default Name";
id = 0;
ad = new Address();
}
public Student(String name, int id, Address ad){
this.name = name;
this.id = id;
this.ad = ad;
}
public String getName(){
return name;
}
public int getId(){
return id;
}
public Address getAddress(){
return ad;
}
public void setName(String name){
this.name = name;
}
public void setId(int id){
this.id = id;
}
public void setAddress(Address ad){
this.ad = ad;
}
public String toString(){
return "Name: " + name + " \nId: " + id + " \n" + ad;
}
}