So I have a class called student and one of the variables is tuition rate, i want to set the tuition in the other class but i dont want to make the variable public, (Its not that big of a deal at the moment but i would like to see if i could) is there a way to do it?
Heres my first part of code from the abstract Student class
public abstract void setTuition(double rateIn); public abstract double getTuition(); abstract String Display()
now heres where im trying to override in the Undergraduate class
@Override public void setTuition(double rateIn){ rateIn=200*super.getHours(); } @Override public String Display(){ return("name "+super.getLastName()+", "+super.getFirstName()+"\n"+ "ID "+super.getStudentId()+"\n"+ "Enrollment "+super.getHours()+"\n"+ "tuition $"+()); //Here i need the variable so i can print it out }
All i need is a way to print out the variable