- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudentApp.java
More file actions
Latest commit
31 lines (30 loc) · 870 Bytes
/
Copy pathStudentApp.java
File metadata and controls
31 lines (30 loc) · 870 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
packagecom.sarvesh.javabasics;
publicclassStudentApp {
staticclassStudent {
Stringname;
intage;
doublemarks;
Student(Stringname, intage, doublemarks) {
this.name = name;
this.age = age;
this.marks = marks;
}
voiddisplayDetails() {
System.out.println("Name: " + name);
System.out.println("Age: " + age);
System.out.println("Marks: " + marks);
}
voidisPassed() {
if (marks >= 40) {
System.out.println("Result: Passed");
} else {
System.out.println("Result: Failed");
}
}
}
publicstaticvoidmain(String[] args) {
Students1 = newStudent("Sarvesh", 20, 75);
s1.displayDetails();
s1.isPassed();
}
}