Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions src/Main.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
// TODO: Create a class called Student with name, rollNumber, and grade

// TODO: Create a method to display student details
class Student{
String name;
int rollnumber;
char grade;
Student(){
name="Sidharth.s";
rollnumber=65;
grade='A';
}
public void displayDetails(){
System.out.println("name:\t"+name);
System.out.println("rollnumber:\t"+rollnumber);
System.out.println("grade:\t"+grade);
}
}
public class Main {
public static void main(String[] args) {
// TODO: Create a Student object and call the method to display details
Student student=new Student();
student.displayDetails();
}
}