Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!

Donald Gatan

Greenhorn
+ Follow
since Jun 16, 2011
Donald likes ...
Eclipse IDE Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Donald Gatan

thanks tushar. CONGRATULATIONS AGAIN!
9 years ago
thanks rahul for a quick response.
9 years ago
CONGRATULATIONS!!!
May I know what specific book did you use? Is it the K&B Mc Graw Hill - SCJP Sun Certified Programmer for Java 6 Exam 310-065 (2008) or the First Head Java 2nd edition? Thank you.
9 years ago
CONGRATULATIONS!
May I know what specific book did you use? Is it the K&B Mc Graw Hill - SCJP Sun Certified Programmer for Java 6 Exam 310-065 (2008) or the First Head Java 2nd edition?
9 years ago
My reference is book of SCJP 6 of Kathy and Bates chapter 2 self test. Thanks for the reply. I will try to figure out again...
9 years ago
Hi Guys,

I tried to figure out the below codes but still i can't get the correct answer based on my simulation on paper.
The answer is letter D. How these codes derived the answer? Can anybody explain in a simple way.

Thanks.

Donald

3. class A { }
4. class B extends A { }
5. public class ComingThru {
6. static String s = "-";
7. public static void main(String[] args) {
8. A[] aa = new A[2];
9. B[] ba = new B[2];
10. sifter(aa);
11. sifter(ba);
12. sifter(7);
13. System.out.println(s);
14. }
15. static void sifter(A[]... a2) { s += "1"; }
16. static void sifter(B[]... b1) { s += "2"; }
17. static void sifter(B[] b1) { s += "3"; }
18. static void sifter(Object o) { s += "4"; }
19. }
What is the result?
A. -124
B. -134
C. -424
D. -434
E. -444
F. Compilation fails

® ✓ D is correct. In general, overloaded var-args methods are chosen last. Remember that arrays
are objects. Finally, an int can be boxed to an Integer and then "widened" to an Object.
9 years ago
Hi Guys,

I tried to figure out the below codes but still i can't get the correct answer based on my simulation on paper.
The answer is letter D. How these codes derived the answer? Can anybody explain in a simple way.

Thanks.

Donald

3. class A { }
4. class B extends A { }
5. public class ComingThru {
6. static String s = "-";
7. public static void main(String[] args) {
8. A[] aa = new A[2];
9. B[] ba = new B[2];
10. sifter(aa);
11. sifter(ba);
12. sifter(7);
13. System.out.println(s);
14. }
15. static void sifter(A[]... a2) { s += "1"; }
16. static void sifter(B[]... b1) { s += "2"; }
17. static void sifter(B[] b1) { s += "3"; }
18. static void sifter(Object o) { s += "4"; }
19. }
What is the result?
A. -124
B. -134
C. -424
D. -434
E. -444
F. Compilation fails

® ✓ D is correct. In general, overloaded var-args methods are chosen last. Remember that arrays
are objects. Finally, an int can be boxed to an Integer and then "widened" to an Object.

Hi to All,

It is very inspiring reading the success of those who took the OCJP 6 exam recently in June 2011.
Congratulations to all.

I am new to the forum and I appreciate your advice in my journey to OCJP 6.
Is it true that SCJP 6 by Kathy Sierra and Bert Bates covers all the concepts in OCJP 6 Exam?
Guys, please give tips how to succeed in this exam.

Is there any schedule or timing sets by the Pearson VUE in taking the OCJP 6 exam for the examiners?

Thank you.

Regards,
Donald

9 years ago