Tamara Lopez

Ranch Hand
+ Follow
since Feb 21, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Tamara Lopez

I think people in general do better in the real exam than whizlabs. This was my case anyway. I was getting around 55 - 65 in whizlabs and 79 in the real exam.
If you do all the questions in whizlabs, and pass the exams, and understand the answers for the ones you got wrong - you should be fine!
Passed SCJP 1.5 today!!!
Really happy about it!
Thanks so much to everyone in this forum, it has helped me so much! And given me a lot more confidence when I heard that people do better in the exam than whizlabs!
Thanks also to Kathy and Bert for a wonderful book!It makes hard topics so much easier, and I love the little jokes throughout the book!
19 years ago
The question reads
"CAN prevent a thread from executing", and not WILL prevent a thread from executing.
Therefore option 2 is correct. It is not guaranteed, but it is possible, that yield takes a thread out of the running state.
Then does that mean the statement is false? Because the objects do not need to implement serializable?
A question in the mock exam with k&b says the following is true:
"When an object is serialized, if it has references to other objects, those objects must be serializable".

But what about if that object reference is marked as transient?
Hey all,

Can I just double check: The drag and drop questions in the exam - can they be of any type? ie theory, fill in the code etc? Of the type of whizlabs?

cheers
oh the question reads "that A thread leaves the running state". I misread that - I thought it meant aLiveThread leaves the running state. In which case f wouldn't be correct.
From K&B mock exams

Assuming that an interrupted exception has not been thrown and that "aLiveThread" is a runnable thread, which three guarantee that a thread will leave the running state?

a) yield()
b) wait()
c) notify()
d) notifyAll()
e) sleep(1000)
f) aLiveThread.join()
g) Thread.killThread()



The correct answers are b e and f.
I dont understand why f is correct. is it not the thread that is calling that method that will leave the running state? In this case main will leave the running state and wait for aLiveThread to finish??
thanks
well done! congratulations
19 years ago
kotha - this will only work with 1.5 because in 1.5 when you override a method you can return a subtype of the type declared in the overriden method.
Do you all find the questions at the end of each chapter in K&B much easier than the real exam?? oh noooooooo - it's on wednesday.....
In this question from whizlabs:
============================

class A{
int x = 5;
}

class B extends A{
int x = 6;
}

public class CovariantTest{
public A getObject(){
return new A();
}

public static void main(String[] args){
CovariantTest c1=new SubCovariantTest();
System.out.println(c1.getObject().x);
}
}

class SubCovariantTest extends CovariantTest{
public B getObject(){
return new B();
}

}
====================================
I understand that variables cannot be overriden.
Here the answer is 5.
But why does c1.getObject() not return B first, and then B.x = 6??
Thanks
I just looked it up and its what it said. To mean one or zero it would be after the character: eg: \\d* or \\d? or ([a-bA-b])+
Check for eg this page out:
http://www.regular-expressions.info/java.html

if you had i? that would mean zero or one i. or (i)?
Compilation wont fail
you are right - it will call super() - which is the parent constructor and print pc then go to the child constructor and print cc
try it out