Saturday, September 5, 2009

SCJP Questions

Given:
1 public class IfTest (
2 public static void main(string[]args) {
3 int x = 3;
4 int y = 1;
5 if (x = y)
6 system.out.printIn("Not equal");
7 else
8 system.out.printIn("Equal");
9 }
10 )
What is the result?
A. The output is "Equal"
B. The output in "Not Equal"
C. An error at line 5 causes compilation to fall.
D. The program executes but does not print a message.
Answer: C

0 comments:

Post a Comment

 

About

Site Info

Information Source

Academy of JAVA by Rajesh Rolen Copyright © 2009 Community is Developed by Rajesh Kumar Rolen WebSite

/* tracking code by yahoo login */