public class QuestionOfTheDay3{
int var1 = 1;
final int var2 = 2;
static int var3 = 3;
QuestionOfTheDay3(){
this(??); // ??
}
QuestionOfTheDay3(int k){
System.out.println(k);
}
public static void main(
String args[]){
QuestionOfTheDay3 q3 = new QuestionOfTheDay3();
}
}
Which of the following variables can be replaced ?? without compiler error?
A1 )var1
A2 )var2
A3 )var3
A4 )All the above.
Answer is var3
Please tell me why constructor can call the instance variable and final variables.
is it right that constructors shouldnever call the instance variables and should always call the static variables???