-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStudent.java
More file actions
20 lines (18 loc) · 667 Bytes
/
Copy pathStudent.java
File metadata and controls
20 lines (18 loc) · 667 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class Student {
int rollNo;
String name;
double marks;
public void displayDetails() {
System.out.println("--- Student Details ---");
System.out.println("Roll No : " + rollNo);
System.out.println("Name : " + name);
System.out.println("Marks : " + marks);
}
public void displayNameFormats() {
System.out.println("\n--- Name Formatting ---");
System.out.println("Original : " + name);
System.out.println("Uppercase : " + name.toUpperCase());
System.out.println("Lowercase : " + name.toLowerCase());
System.out.println("Length : " + name.length());
}
}