-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLE0.java
43 lines (31 loc) · 1.11 KB
/
LE0.java
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
43
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
public class JUET {
String name;
int age;
public String getName() {
return name;
}
void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
void setAge(int age) {
this.age = age;
}
public static void main(String[] args) {
JUET student = new JUET("John", 20);
System.out.println("Name: " + student.getName());
System.out.println("Age: " + student.getAge());
student.setName("Alice");
student.setAge(22);
System.out.println("Updated Name: " + student.getName());
System.out.println("Updated Age: " + student.getAge());
}
}