Friday, September 4, 2009

SCJP Questions

Exhibit:
1 public class test(
2 public int aMethod()[
3 static int i=0;
4 i++;
5 return I;
6 )
7 public static void main (String args[]){
8 test test = new test();
9 test.aMethod();
10.int j = test.aMethod();
11.System.out.printIn(j);
12.]
13.}
What is the result?
A. Compilation will fail.
B. Compilation will succeed and the program will print "0"
C. Compilation will succeed and the program will print "1"
D. Compilation will succeed and the program will print "2"
Answer: D

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 */