Aarti Dahiya

Greenhorn
+ Follow
since Aug 07, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Aarti Dahiya

<html:select property="foodType"> <html ption value=" "><fmt:message key="Select a food type"></html ption>
<html ptions collection="foodTypeList" property="keyString" labelProperty="valueString"/>
</html:select>

foodTypeList is a collection that has these elements:-
Entree
Snack
Dessert

How to set Entree as the default?

Thankz in advance.
18 years ago
Thanks guys!

Vivek, I never read JLS. Just practiced with mock exams and when in doubt wrote short code to see actually how it compiles and what output it gave. Made more modifications to the code to see how the compilationa and output changed. Also, I never got such a high score on any of the mock exams.
So, work out as many mock exams as you can! Try and understand the concepts rather than cramming them.

All the best Murtuza!
20 years ago
Dan,

I used to get between 60% and 70% on your exams. Your exams were very helpful. The actual exam is definitely easier than your exams, but they were a great help!
I prepared for SCJP for 3 weeks only. I'm glad I did well!
20 years ago
I'm very happy for passing the exam with such a high score!!!
Thanks to K&B book, Marcus Green's test and Dan's tests and other mock tests available online and this site, of course.
20 years ago
Yes, Barry you are right! Making x final compiles just fine.
I copied the code wrong when I compiled it.
Making x final still gives a compilation error.
The only thing that might compile this code is using if(true). The compiler knows that the condition is TRUE always, and does not depend on anything else.
A reference to the object which invokes the non-static method is passed IMPLICITLY to the non-static method.
The method call t.piggy(sName) invokes the method piggy. Apart from the reference t, piggy has its own reference to the object referenced by t. It has been passed implicitly. So, when start() is called it is actually t.start().
Static variables are declared and initialized when the class gets loaded at runtime. Since they are not tied to a specific instance of a class, their declaration and initialization does not wait for an instance of a class to be created. t1 and t3 are declared and initialized when the class is loaded, so the Test construtor is called twice separately and prints Test1, Test3.
main() is executed at runtime after the class has been loaded. In main() when an instance of class Q12 is created, its instance variable t2 is declared and initialized. The Test construcor is called and prints Test2.
K&B book states that the yield() method may cause a running thread to back out if there are runnable threads of the SAME priority.
In one of the mock tests (don't remember which one), it states that the yield() method may cause a running thread to back out if there are runnable threads of the SAME OR HIGHER priority.

Which one is correct?

Thanks.
For the first three iterations of the do while loop, the default case of the switch statement executes (x changes from -5 to -3, -1, 1). After the first three iterations x is 1.
In the fourth iteration of the loop, case 1 is executed which PRINTS 1 and changes x to 4. In the fifth iteration, case 4 is executed which PRINTS 4 and changes x to 3.
In the sixth iteration, case 3 is executed which PRINTS 3 and changes success to 1.
In the seventh iteration, case 3 is executed again which PRINTS 3 and changes success to 2.
At this point, success is 2 and x is 3. So, the while condition is false and the loop terminates.
Hence, the output is 1433.
Thanks Dan! I went over the methods in Iterator and Enumeration interfaces. They are quite easy.
I am taking SCJP in a couple of days. I got 73% and 80% on Marcus's two mock tests after I went over K&B once. Now, I have revised and improved upon all my weak areas and hope to do better on the mock tests I take from now on. What do you think about my percentages on the mock tests before revision in regards to the actual SCJP1.4.

Thanks.
Max,

The this reference (ie the reference to the current executing object) is NOT implicitly passed to a static method. Since, a static method is not tied to a specific instance of a class. It results in a compile time eror.
Which book are you gonna use for preparation?

I'm taking the exam in a couple of days and I've read and taken the self tests of Kathy Sierra, Bert Bates book. Also, I worked out single topic tests from Khalid Mughal's book, apart from the online mock tests. The K&B book will give you the idea on exactly what to study for SCJP.

Hope this helps.
Figure 7.4 in K&B book is all that it gives about Iterator. Is that all I need to know? What about Enumeration?

Thanks.
I am preparing for SCJP 1.4. I noticed some questions on Enumeration and Iterator on Dan's mock exams. But, there were none in K&B book on these topics. Is it to be covered for SCJP 1.4? Are there questions on the exam on these topics?

Thanks.