Subscribe To MegiSoft RSS Feeds!     Your Browser OR  Google Feedburner

home

home_image_top-color





Java Quiz!

What happens when the following program is compiled and run.

public class MyClass {

	public static void main(String[] args){
		int y = 3;
		for(int x = 0; x < 3; x ++ ) {
			System.out.print("-x" + x);
			if(x == 1) {
				System.out.print("-x" + y);
			}
			if(x == 0) {
				int b = x + y;
				System.out.print("-x" + b);
			}
		}
	}
}

Select the correct answer.


Click here for more tests!

 Subscribe To Megisoft RSS Feeds! (Your Browser)
 Mail This Page To A Friend!
 Bookmark This Page!
megisoft © 2016