Tere Luna

+ Follow
since Jul 19, 2011
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tere Luna

Hello All,

I found this guide to get ready for the SCWCD/OCPJWCD certifcation

but I wonder, if someone can give me an advice on which guide I should use?


Thanks a lot and Kind Regards,

Tere LUna
Hi All,

Thanks in advance for your help

I am OCPJP now, I got my certification last month, and now I want to step forward. I was checking the certification paths at the Oracle website, but I don't see a certification named like that. Instead I see
Oracle Certified Expert, Java Platform, Enterprise Edition 6 JavaServer Pages and Servlet Developer , and I assume this is the same as SCWCD.

And one more thing, what is the book you can suggest to prepare for this certification? ie, I used the guide written by Kathy Sierra to get the OCPJP.

Thanks for your help,

Kind Regards,
Thank you Cole for your answer I think I understand now
Hi All,

I have a doubt on the below question of the Self Test of Chapter 9 written in the SCJP 6 Guide,

13. Given:
3. public class Starter implements Runnable {
4. void go(long id) {
5. System.out.println(id);
6. }
7. public static void main(String[] args) {
8. System.out.print(Thread.currentThread().getId() + " ");
9. // insert code here

10. }
11. public void run() { go(Thread.currentThread().getId()); }
12. }
And given the following five fragments:
I. new Starter().run();
II. new Starter().start();
III. new Thread(new Starter());
IV. new Thread(new Starter()).run();
V. new Thread(new Starter()).start();
When the five fragments are inserted, one at a time at line 9, which are true? (Choose all that apply.)
A. All five will compile
B. Only one might produce the output 4 4
C. Only one might produce the output 4 2
D. Exactly two might produce the output 4 4
E. Exactly two might produce the output 4 2
F. Exactly three might produce the output 4 4
G. Exactly three might produce the output 4 2

􀀂 ✓ C and D are correct. Fragment I doesn't start a new thread. Fragment II doesn't compile.
Fragment III creates a new thread but doesn't start it. Fragment IV creates a new thread
and invokes run() directly, but it doesn’t start the new thread. Fragment V creates and
starts a new thread.
􀀂􀀁 A, B, E, F, and G are incorrect based on the above. (Objective 4.1)

Can anyone explain to me why C and D are correct? I don't really understand
Thanks you Tommy, I'm checking it out right now
Yes please, help us identify which topics that are in the guide written by Kathy Sierra and Bert Bates are not in the exam, since they mention almost all the topics are includee

Thanks everyone for your answers. They have been very helpful

I'm not sure why this following code (it's in one of the questions for SCJP guide in chapter 6)

El resultado es "10 0 10", I guess that the static variable z was indeed serialized and deserialized or why does it have the value of 10?

Thanks a lot
Thank you Boris

Your explanation is very clear! Now I'm testing by using only primitive not wrapper, like in the code below

And I get the "Type mismatch: cannot convert from int to short" compiler error in line 2. I thought this could be implicit casting :S

Thanks for your help !
Hi All

I'm a little confused about implicit and explicit casting in Java. I'm preparing for OCPJP, but I have the below code, and I wonder why when you perform an arithmetic operation using literals like 3/2, that can be assigned to a short type attribute, but if you try to perform the same operation but using a variable like short1/4, you get a compiler error. Also the same in the line 5, where you want to assign a byte to a short, I would assume it would compile since byte is lower precision than short, and I would think it would perform an implicit casting

1. Short short1 = 3;
2. Byte byte1 = 4;
3. short1 = 3/2;
4. Short short2 = short1 / 4;
5. short1 = byte1;

Thanks for your help