Hi guys i can't work out what is wrong with my code here
public class Student { // instance variables - replace the example below with your own private String Id; private String stuName; private int gradeAverage; /** * Constructor for objects of class Student */ public Student() { // initialise instance variables Id = "20054425"; stuName = "Marco Perrozzi"; gradeAverage = 80; } public Student(String Id, String stuName, int gradeAverage) { // initialise instance variables Id = Id; stuName = stuName; gradeAverage = gradeAverage; } public String getId() { return Id;} public String getstuName() {return stuName;} public int getgradeAverage() {return gradeAverage;} }
THAT NEEDS TO LINK UP WITH THIS
public class StudentClient { public static void main(String args[]){ Student defaultStudent = new Student("12345", "Marco P", 90); System.out.println("Default student Id is: "+defaultStudent.getId()); System.out.println("Default Student Name is: "+defaultStudent.getstuName()); System.out.println("Default Grade average is: "+defaultStudent.getgradeAverage()); defaultStudent.SetId("3546737"); defaultStudent.setstuName("John D"); defaultStudent.setgradeAverage(35); // System.out.println("Default student Id is: "+infoStudent()); System.out.println("Info student Id is: "+ defaultStudent.getId()); System.out.println("Info Student Name is: "+ defaultStudent.getstuName()); System.out.println("Info Grade average is: "+ defaultStudent.getgradeAverage()); } }
So what am i doing wrong and what are the mistakes ?
Thanks