Create a class Student with the states (attributes): Name, address, phone number, Student ID. Also define the behavior of student as learn, perform assignment, read, attendance, do presentation (Exemple: My name is {Name}). After that create 3 instances of the class Student and present the instance (My name is .....)
Ans.
Public class Student {
String name = anubhav;
String address = xyz;
Int phone number = 1237367388;
Int student ID = 137;
String learn = xyz;
String perform assignment =xyz;
String read = xyz;
Float attendencef = xyz;
Public static void main (String[]args) {
Student st = new Student;
System.out.println("my name is =" +st.anubhav ) ;
System.out.println("my address is =" +st.xyz) ;
System.out.println("my phone number is =" +st.1237367388);
.
. // same process
.
}
}
Get Answers For Free
Most questions answered within 1 hours.