Given:
7. public interface Ndesit {
8. /* insert code here */ int score = 8;
9. }
Which 3 are valid on line 8? (Choose 3)
A. final
B. static
C. native
D. public
E. private
F. abstract
G. protected
This is your world! It's not just Java
Monday, October 24, 2011
Quiz of the Day | OCPJP (35)
Posted by
Paiman
at
3:34 PM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Sunday, October 9, 2011
Quiz of the day | OCPJP (34)
Given:
3. class K {
4. String name = "kentang ";
5. String makeNoise() { return "ngentang"; }
6. }
7. class S extends K {
8. String name = "surikoyo ";
9. String makeNoise() { return "nyurikoyo"; }
10. }
11. public class ZK {
12. public static void main(String[] args) { new ZK().go(); }
13. void go() {
14. K k = new S();
15. System.out.println(k.name + k.makeNoise());
16. }
17. }
What is the result?
A. kentang nyurikoyo
B. surikoyo nyurikoyo
C. kentang ngentang
D. surikoyo ngentang
E. Compilation fails
F. An exception is thrown at runtime
3. class K {
4. String name = "kentang ";
5. String makeNoise() { return "ngentang"; }
6. }
7. class S extends K {
8. String name = "surikoyo ";
9. String makeNoise() { return "nyurikoyo"; }
10. }
11. public class ZK {
12. public static void main(String[] args) { new ZK().go(); }
13. void go() {
14. K k = new S();
15. System.out.println(k.name + k.makeNoise());
16. }
17. }
What is the result?
A. kentang nyurikoyo
B. surikoyo nyurikoyo
C. kentang ngentang
D. surikoyo ngentang
E. Compilation fails
F. An exception is thrown at runtime
Posted by
Paiman
at
4:27 PM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Saturday, October 8, 2011
Quiz of the day | OCPJP (33)
Given:
1. public class Tingting implements Ayu
{ public void doIt() { } }
2.
3. abstract class Phone1 extends Electronic { }
4.
5. abstract class Phone2 extends Electronic
{ public void doIt(int x) { } }
6.
7. class Phone3 extends Electronic implements Ayu
{ public void doStuff() { } }
8.
9. interface Device { public void doIt(); }
What is the result? (Choose all that apply.)
A. Compilation succeeds
B. Compilation fails with an error on line 1
C. Compilation fails with an error on line 3
D. Compilation fails with an error on line 5
E. Compilation fails with an error on line 7
F. Compilation fails with an error on line 9
DOWNLOAD the answer
1. public class Tingting implements Ayu
{ public void doIt() { } }
2.
3. abstract class Phone1 extends Electronic { }
4.
5. abstract class Phone2 extends Electronic
{ public void doIt(int x) { } }
6.
7. class Phone3 extends Electronic implements Ayu
{ public void doStuff() { } }
8.
9. interface Device { public void doIt(); }
What is the result? (Choose all that apply.)
A. Compilation succeeds
B. Compilation fails with an error on line 1
C. Compilation fails with an error on line 3
D. Compilation fails with an error on line 5
E. Compilation fails with an error on line 7
F. Compilation fails with an error on line 9
DOWNLOAD the answer
Posted by
Paiman
at
11:06 AM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Friday, October 7, 2011
Quiz of the day | OCPJP (32)
Given:
1. class Pocong {
2. public static void main(String[] args) {
3. doStuff(8);
4. doStuff(8,9);
5. }
6. // insert code here
7. }
Which, inserted independently at line 6, will compile? (Choose all that
apply.)
A. static void doStuff(int... doArgs) { }
B. static void doStuff(int[] doArgs) { }
C. static void doStuff(int doArgs...) { }
D. static void doStuff(int... doArgs, int y) { }
E. static void doStuff(int x, int... doArgs) { }
DOWNLOAD the answer
1. class Pocong {
2. public static void main(String[] args) {
3. doStuff(8);
4. doStuff(8,9);
5. }
6. // insert code here
7. }
Which, inserted independently at line 6, will compile? (Choose all that
apply.)
A. static void doStuff(int... doArgs) { }
B. static void doStuff(int[] doArgs) { }
C. static void doStuff(int doArgs...) { }
D. static void doStuff(int... doArgs, int y) { }
E. static void doStuff(int x, int... doArgs) { }
DOWNLOAD the answer
Posted by
Paiman
at
1:14 PM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Thursday, October 6, 2011
Quiz of the day | OCPJP (31)
Which method names follow the JavaBeans standard? (Choose all that apply.)
A. addBook
B. getProduct
C. deleteShirt
D. isThree
E. putBall
DOWNLOAD the answer
A. addBook
B. getProduct
C. deleteShirt
D. isThree
E. putBall
DOWNLOAD the answer
Posted by
Paiman
at
8:17 PM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Wednesday, October 5, 2011
Quiz of the day | OCPJP (30)
Given:
4. class WongJowo {
5. public static void main(String[] args) {
6. for(int __w = 0; __w < 5; __w++) ;
7. int #jw = 8;
8. long [] x [2];
9. Boolean []wj[];
10. enum Lanang { NGGANTENG, GAGAH, PINTER };
11. }
12. }
What is the result? (Choose all that apply.)
A. Compilation succeeds
B. Compilation fails with an error on line 6
C. Compilation fails with an error on line 7
D. Compilation fails with an error on line 8
E. Compilation fails with an error on line 9
F. Compilation fails with an error on line 10
DOWNLOAD the answer
4. class WongJowo {
5. public static void main(String[] args) {
6. for(int __w = 0; __w < 5; __w++) ;
7. int #jw = 8;
8. long [] x [2];
9. Boolean []wj[];
10. enum Lanang { NGGANTENG, GAGAH, PINTER };
11. }
12. }
What is the result? (Choose all that apply.)
A. Compilation succeeds
B. Compilation fails with an error on line 6
C. Compilation fails with an error on line 7
D. Compilation fails with an error on line 8
E. Compilation fails with an error on line 9
F. Compilation fails with an error on line 10
DOWNLOAD the answer
Posted by
Paiman
at
10:13 PM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Tuesday, October 4, 2011
Quiz of the day | OCPJP (29)
Given:
3. public class Bunga {
4. public enum Kembang { MAWAR, SETAMAN, DESA };
5. public static void main(String[] args) {
6. for(Kembang k : Kembang.values() )
7. ;
8. Kembang [] k2 = Kembang.values();
9. System.out.println(k2[2]);
10. }
11. }
What is the result? (Choose all that apply.)
A. SETAMAN
B. DESA
C. The output is unpredictable
D. Compilation fails due to an error on line 4
E. Compilation fails due to an error on line 6
F. Compilation fails due to an error on line 8
G. Compilation fails due to an error on line 9
DOWNLOAD the answer
3. public class Bunga {
4. public enum Kembang { MAWAR, SETAMAN, DESA };
5. public static void main(String[] args) {
6. for(Kembang k : Kembang.values() )
7. ;
8. Kembang [] k2 = Kembang.values();
9. System.out.println(k2[2]);
10. }
11. }
What is the result? (Choose all that apply.)
A. SETAMAN
B. DESA
C. The output is unpredictable
D. Compilation fails due to an error on line 4
E. Compilation fails due to an error on line 6
F. Compilation fails due to an error on line 8
G. Compilation fails due to an error on line 9
DOWNLOAD the answer
Posted by
Paiman
at
8:59 AM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Monday, October 3, 2011
Quiz of the day | OCPJP (28)
Given:
4. public class Kancil extends Kijang {
5. public static void main(String[] args) {
6. Short sikil = 4;
7. System.out.println(jumlah(sikil, 4));
8. }
9. }
10. class Kijang {http://www.blogger.com/img/blank.gif
11. int jumlah(int x, int y) { return x + y; }
12. }
What is the result?
A. 8
B. Compilation fails due to multiple errors
C. Compilation fails due to an error on line 6
D. Compilation fails due to an error on line 7
E. Compilation fails due to an error on line 11
4. public class Kancil extends Kijang {
5. public static void main(String[] args) {
6. Short sikil = 4;
7. System.out.println(jumlah(sikil, 4));
8. }
9. }
10. class Kijang {http://www.blogger.com/img/blank.gif
11. int jumlah(int x, int y) { return x + y; }
12. }
What is the result?
A. 8
B. Compilation fails due to multiple errors
C. Compilation fails due to an error on line 6
D. Compilation fails due to an error on line 7
E. Compilation fails due to an error on line 11
Posted by
Paiman
at
1:27 PM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Sunday, October 2, 2011
Quiz of the day | OCPJP (27)
Given two files:
1. package x;
2. public class J {
3. int a = 1;
4. protected int b = 2;
5. public int c = 3;
6. }
3. package y;
4. import x.*;
5. public class H {
6. public static void main(String[] args) {
7. J j = new J();
8. System.out.print(" " + j.a);
9. System.out.print(" " + j.b);
10. System.out.print(" " + j.c);
11. }
12. }
http://www.blogger.com/img/blank.gif
What is the result? (Choose all that apply.)
A. 1 2 3
B. 1 followed by an exception
C. Compilation fails with an error on line 7
D. Compilation fails with an error on line 8
E. Compilation fails with an error on line 9
F. Compilation fails with an error on line 10
DOWNLOAD the answer
1. package x;
2. public class J {
3. int a = 1;
4. protected int b = 2;
5. public int c = 3;
6. }
3. package y;
4. import x.*;
5. public class H {
6. public static void main(String[] args) {
7. J j = new J();
8. System.out.print(" " + j.a);
9. System.out.print(" " + j.b);
10. System.out.print(" " + j.c);
11. }
12. }
http://www.blogger.com/img/blank.gif
What is the result? (Choose all that apply.)
A. 1 2 3
B. 1 followed by an exception
C. Compilation fails with an error on line 7
D. Compilation fails with an error on line 8
E. Compilation fails with an error on line 9
F. Compilation fails with an error on line 10
DOWNLOAD the answer
Posted by
Paiman
at
10:02 PM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
OCPJP
Saturday, October 1, 2011
Quiz of the day | OCPJP (26)
Given:
1. enum Kewan {
2. KIRIK("guk"), KUCING("meong"), WEDUS("mbek");
3. String suoro;
4. Kewan(String s) { suoro = s; }
5. }
6. class Enum {
7. static Kewan a;
8. public static void main(String [] args) {
9. System.out.println(a.KIRIK.suoro + " " + a.WEDUS.suoro);
10. }
11. }
What is the result?
A. guk mbek
B. Multiple compilation errors
C. Compilation fails due to an error on line 2
D. Compilation fails due to an error on line 3
E. Compilation fails due to an error on line 4
F. Compilation fails due to an error on line 9
DOWNLOAD the answer
1. enum Kewan {
2. KIRIK("guk"), KUCING("meong"), WEDUS("mbek");
3. String suoro;
4. Kewan(String s) { suoro = s; }
5. }
6. class Enum {
7. static Kewan a;
8. public static void main(String [] args) {
9. System.out.println(a.KIRIK.suoro + " " + a.WEDUS.suoro);
10. }
11. }
What is the result?
A. guk mbek
B. Multiple compilation errors
C. Compilation fails due to an error on line 2
D. Compilation fails due to an error on line 3
E. Compilation fails due to an error on line 4
F. Compilation fails due to an error on line 9
DOWNLOAD the answer
Posted by
Paiman
at
9:50 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.