Code:
Student.java
class Student{
//variable declaration
int id;
String name;
String gender;
//method deinitions
boolean updateProfile(String newName){
name=newName;
return true;
}
}
StudentTest.java
class StudentTest{
public static void main(String[] args){
//Creating a new student object
Student s = new Student();
//setting student state
s.id =1000;
s.name="Zaki";
s.gender="male";
//3. Update your profile with correct name
s.updateProfile("John");
}
}
