class A {
int i=0;
public int getValue(){
return i++;
}
}
class Test {
public static void main ( String args [ ] ) {
System.out.println(new A().getValue());
}
}
Answer:
The output is 0.
First the value is returned and only then it is incremented and stored.
No comments:
Post a Comment