Given:
3. public class Sep26 {
4. public static void main(String[] args) {
5. short f4 = 4;
6. new Sep26().go(f4);
7. new Sep26().go(new Integer(8));
8. }
9. void go(Short s) { System.out.print("S "); }
10. void go(Long l) { System.out.print("L "); }
11. void go(int i) { System.out.print("i "); }
12. void go(Number n) { System.out.print("N "); }
13. }
What is the result?
A. i L
B. i N
C. S L
D. S N
E. Compilation fails.
F. An exception is thrown at runtime.
DOWNLOAD the answer
This is your world! It's not just Java
Monday, September 26, 2011
Quiz of the day | OCPJP (21)
Posted by
Paiman
at
8:12 AM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Sunday, September 25, 2011
Quiz of the day | OCPJP (20)
Given:
2. public class X {
3. private int g = 3;
4. public static void main(String[] args) {
5. new X().xii();
6. }
7. void xii() {
8. int x = 6;
9. Y y = new Y();
10. class Y {
11. void yii() { System.out.println(g + x); }
12. }
13. y.yii();
14. }
15. }
What is the result? (Choose all that apply.)
A. Compilation succeeds.
B. Compilation fails due to an error on line 3.
C. Compilation fails due to an error on line 8.
D. Compilation fails due to an error on line 9.
E. Compilation fails due to an error on line 10.
F. Compilation fails due to accessing x on line 11.
G. Compilation fails due to accessing y on line 11.
DOWNLOAD the answer
2. public class X {
3. private int g = 3;
4. public static void main(String[] args) {
5. new X().xii();
6. }
7. void xii() {
8. int x = 6;
9. Y y = new Y();
10. class Y {
11. void yii() { System.out.println(g + x); }
12. }
13. y.yii();
14. }
15. }
What is the result? (Choose all that apply.)
A. Compilation succeeds.
B. Compilation fails due to an error on line 3.
C. Compilation fails due to an error on line 8.
D. Compilation fails due to an error on line 9.
E. Compilation fails due to an error on line 10.
F. Compilation fails due to accessing x on line 11.
G. Compilation fails due to accessing y on line 11.
DOWNLOAD the answer
Posted by
Paiman
at
9:56 PM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Saturday, September 24, 2011
Quiz of the day | OCPJP (19)
Given:
3. public class O {
4. private int a = 2;
5. protected int s = 3;
6. private static int d = 4;
7. protected static int f = 5;
8. public static void main(String[] args) {
9. int a = 6; int s = 7;
10. int d = 8; int f = 9;
11. new O().new P().p();
12. }
13. class P {
14. void p() { System.out.println(a + " " + s + " " + d + " " + f); }
15. } }
What is the result?
A. 2 3 4 5
B. 2 7 4 9
C. 6 3 8 4
D. 6 7 8 9
E. Compilation fails due to multiple errors.
F. Compilation fails due only to an error on line 11.
G. Compilation fails due only to an error on line 14.
DOWNLOAD the answer
3. public class O {
4. private int a = 2;
5. protected int s = 3;
6. private static int d = 4;
7. protected static int f = 5;
8. public static void main(String[] args) {
9. int a = 6; int s = 7;
10. int d = 8; int f = 9;
11. new O().new P().p();
12. }
13. class P {
14. void p() { System.out.println(a + " " + s + " " + d + " " + f); }
15. } }
What is the result?
A. 2 3 4 5
B. 2 7 4 9
C. 6 3 8 4
D. 6 7 8 9
E. Compilation fails due to multiple errors.
F. Compilation fails due only to an error on line 11.
G. Compilation fails due only to an error on line 14.
DOWNLOAD the answer
Posted by
Paiman
at
8:41 AM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Friday, September 23, 2011
Quiz of the day | OCPJP (18)
Given:
2. interface A { void a(); }
3. // insert code here
Which code, inserted independently at line 3, will compile? (Choose
all that apply.)
A. interface B extends A { }
B. interface B extends A { void a(); }
C. interface B extends A { void doA(); }
D. interface B extends A { void a() { ; } }
E. interface B extends A { protected void a(); }
F. interface B extends A { void a(); void doA(); }
DOWNLOAD the answer
2. interface A { void a(); }
3. // insert code here
Which code, inserted independently at line 3, will compile? (Choose
all that apply.)
A. interface B extends A { }
B. interface B extends A { void a(); }
C. interface B extends A { void doA(); }
D. interface B extends A { void a() { ; } }
E. interface B extends A { protected void a(); }
F. interface B extends A { void a(); void doA(); }
DOWNLOAD the answer
Posted by
Paiman
at
8:21 AM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Thursday, September 22, 2011
Quiz of the day | OCPJP (17)
Which are valid command-line switches when working with assertions? (Choose all that apply.)
A. -ea
B. -da
C. -dsa
D. -eva
E. -enableassertions
DOWNLOAD the answer
A. -ea
B. -da
C. -dsa
D. -eva
E. -enableassertions
DOWNLOAD the answer
Posted by
Paiman
at
8:53 AM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Leave a Message
Blog Archive
-
▼
2011
(40)
-
▼
October
(11)
- Quiz of the Day | OCPJP (35)
- Quiz of the day | OCPJP (34)
- Quiz of the day | OCPJP (33)
- Quiz of the day | OCPJP (32)
- Quiz of the day | OCPJP (31)
- Quiz of the day | OCPJP (30)
- Quiz of the day | OCPJP (29)
- Quiz of the day | OCPJP (28)
- Quiz of the day | OCPJP (27)
- Quiz of the day | OCPJP (26)
- Quiz of the day | OCPJP (22)
-
▼
October
(11)
Labels
- About Java (2)
- Ajax (1)
- Animation (1)
- Array (1)
- BufferedReader (1)
- C# (1)
- C++ (1)
- Certification (5)
- Cryptography (1)
- Download (37)
- Eclipse (1)
- EJB (2)
- Game (3)
- Hibernate (3)
- Input Data (2)
- J2ME (1)
- Java 2D (1)
- Java 3D (1)
- Java Advance (1)
- Java Basic (6)
- Java Networking (1)
- Java RMI (1)
- Java Secrets (1)
- Java Swing (3)
- Java Thread (2)
- Java Tutorial (4)
- JavaFX (3)
- JDBC (1)
- JMS (1)
- JSP (1)
- Linux (1)
- MySQL (1)
- OCPJP (34)
- Opinion (2)
- Oracle (1)
- PHP (1)
- Scanner (1)
- SCJP (1)
- SCWCD (1)
- Silverlight (1)
- Spring (1)
- Tutorial (2)
- Web Service (1)
- Wireless (1)
Powered by Blogger.