Welcome Guest | Sign in | Register
Variables and Loops - Discussion Page For Q.2998 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Variables and Loops > Questions and Answers

Q: public class This {
int i;

This(){
this.i++;
i++;
}

public static void main(String[] args){
This o=new This();
System.out.print(o.i);
}
}

What will be output of above program?
A. Garbage value B. 1
C. 2 D. Non static variable must be initialized, Compiler error

Answer and Explanation

Answer:2

Explanation:
There is no explanation...

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.