-
Notifications
You must be signed in to change notification settings - Fork 0
/
Student_Class.java
49 lines (40 loc) · 942 Bytes
/
Student_Class.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
44
45
46
47
48
49
package Practice;
import static java.lang.System.out;
public class Student_Class
{
boolean name;
int age;
void ClassMate()
{
name = true;
age = 10;
}
void Uni_Mate()
{
name = false;
age = 20;
}
void MakeStudent(int newage)
{
age = newage;
}
void PrintState()
{
out.println("Current State:-");
out.println("Name:-" + name);
out.println("Age:-" + age);
}
public static void main(String[] args)
{
Student_Class obj1 , obj2;
obj1 = new Student_Class();
obj2 = new Student_Class();
obj1.ClassMate();
obj2.ClassMate();
obj1.Uni_Mate();
obj2.Uni_Mate();
obj1.MakeStudent(30);
obj1.PrintState();
obj1.PrintState();
}
}