-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudentClassTest.java
More file actions
35 lines (22 loc) · 920 Bytes
/
StudentClassTest.java
File metadata and controls
35 lines (22 loc) · 920 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
package lab6;
public class StudentClassTest {
public static void main(String[] args) {
// Create a Student object
Student student1 = new Student("Alice", 101);
// Get student ID
int id = student1.getId();
System.out.println("Student ID: " + id);
// Get student email
String email = student1.getEmail();
System.out.println("Student Email: " + email);
// Create another Student object
Student student2 = new Student("Bob", 102);
int id1 = student2.getId();
System.out.println("Student ID: " + id1);
// Get student email
String email1 = student2.getEmail();
System.out.println("Student Email: " + email1);
// Display total number of students
System.out.println("Total Students: " + Student.getTotalStudents());
}
}