I'm new at Java and I'm attempting on my very first coding, but i hit a bump as in if i type private before data types it will say
The value of the field Teacher.tea_id is not used
The value of the field Teacher.name is not used
Nevertheless, if i removed "private" method then the error also was solved, so i wonder is the method automatically converted to public when i removed "private"? And why error exists with private?
Btw, i also have another class namely "score", i'm not sure if i set a variable like sum which represents the sum total of several other variables, can i just continue use it in other classes such as the teacher in this case? But of course they are in the same package.
FYI, the teacher class looks like that:
public class Teacher {
private int tea_id;
private String name;
Score Score;
public Teacher(int tea_id, String name)
{
this.name = name;
this.tea_id = tea_id;
Score = new Score();
}
public void input(float num, int course){}
public void input(float[] score){}
public void check(){}
public float getSum(){return Score.sum;}
public float getAverage(){return Score.average;}
}
Hope i have clearly delivered my problem to you, and will clarify further if needed.