I have a project that involves creating objects of varying types that inherit methods and variables from a super class, but when I try to change the variable in the subclass (to a value inputted through the constructor) the variable remains the same value it is initialized to in the super class.
This is one of the variables the super makes:
public int grade = 0;
and this is what happens in the subclass (newGrade comes through the constructor).
System.out.println(newGrade);
newGrade = grade;
System.out.println(grade);
Output shows newGrade = 1 (or whatever is selected) but grade = 0
I'm not sure if its something simple or something i've overlooked but I would appreciate any tips.
valueto thenewGrade, you need to flid that statement:grade = newGrade;