-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
42 lines (31 loc) · 691 Bytes
/
Test.java
File metadata and controls
42 lines (31 loc) · 691 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
41
42
class Student {
String name;
int roll;
static String collegeName="NCIT";
// setters
public void setName(String name){
this.name=name;
}
public void setRoll(int roll){
this.roll=roll;
}
// getters
public String getName(){
return this.name;
}
public int getRoll(){
return this.roll;
}
static public String getcollegeName(){
return collegeName;
}
}
class Test {
public static void main(String[] arg){
Student obj=new Student();
obj.setName("Hari");
obj.setRoll(22);
System.out.println(obj.getName());
Student.getcollegeName();
}
}