Thank you copeg,
By removing the final from the line "private final int num = 10;", the program tends to have "making forward references" problem.
Child constructor -> Parent constructor -> ...
Type: Posts; User: SmokyBrain
Thank you copeg,
By removing the final from the line "private final int num = 10;", the program tends to have "making forward references" problem.
Child constructor -> Parent constructor -> ...
Codes:
class Parent {
protected int value = 1 ;
Parent() {
value = getNum();
}
public int getNum(){
return 5;