Friday, September 4, 2009

SCJP Questions

1 class super (
2 public int I = 0;
3
4 public super (string text) (
5 I = 1
6 )
7 )
8
9 public class sub extends super (
10 public sub (string text) (
11 i= 2
12 )
13
14 public static void main (straing args[]) (
15 sub sub = new sub ("Hello");
16 system.out. PrintIn(sub.i);
17 )
18 )
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: A

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