Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!

J Sato

Ranch Hand
+ Follow
since Mar 30, 2006
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 J Sato

See a few posts down:

I was consistently scoring 55-60% on the Whizlabs exams and ended up passing the real one with a 70%...not the best score, but I gave myself 6 weeks to study a few hours a day with the goal of passing, which I did. However, for the 5 minutes between when I finished and when they finally got my score report to print, I gave myself a 50/50 chance of passing. If you understand the material, I say go for it. Good luck and welcome to Javaranch!

After not sleeping and not eating, I took the SCJP 1.5 this morning and passed with a 70%. I'm pretty happy with that since I only had 6 weeks of studying and consistently failed the practice and Whizlabs exams.

Thanks to all in the Javaranch community who have helped! Since this will be moved, I'll put up another post later with some tips that I come up with. (And after I do some serious celebratin'!)

15 years ago
Thanks, fortunatlely nothing like that was on the real exam!
See here (includes links to other discussions on this question).

And welcome to Javaranch!
[ April 21, 2006: Message edited by: J Sato ]
I'm having trouble figuring out what is put where in arr in this statement:

For example, how do I tell what arr[1][1][2] is? All the {{}}s tend to confuse me. Is there an easy way to write this out when I take the test?

You can try casting the ints to floats to see what happens. Such as:

[ April 20, 2006: Message edited by: J Sato ]
You should remember that static variables aren't tied to any instance of the class. When you print k, it returns 1 because the init block only runs when you create a new instance. You might try the following modifications (or combinations of them) to help you understand:

-make the init block static
-create an instance of Test9 and return k
-create an instance of Test9 and return k for that instance
-remove the static modifier from the variable

Some of these will cause compilation failures, but playing with the code should help it to make more sense. HTH
When I try the example it compiles and runs fine. Are you sure the constructor is private?

Typically, you would have a public method getInstance() in the class with the private constructor to create an instance of that class. This is used in the Singleton Design Pattern. But that won't be on the exam.

Also, Bert would have you know there's a whole chapter on the Singleton Pattern in the book Head First Design Patterns.
[ April 19, 2006: Message edited by: J Sato ]
Instance variables are not overridden so when the getNumber() method is called it returns number from class A. You might try overriding the getNumber() method in class B and see if the output gives you what you initially expected to see. Like this:
I believe s/b means "should be".
Whizlabs isn't perfect (minor bugs in the UI, a few questions cover material not on the exam), but I've found it very helpful in preparing for the SCJP. You can download the trial first and then when you purchase the full version you receive a license key. You don't have to wait for delivery.
Can anyone provide more detail on what we need to know regarding interrupt()? I do not recall reading about it in the K&B book. If it's there and I just missed it, if someone could point that out too I'd appreciate it.


This is my understanding. If the original question was why doesn't "Base constructor called on the sly" appear in the output after "ChildClass2 constructor called" it is because it appears before it.

------- BaseClass("One") -------
Base constructor directly called

------- ChildClass1("Two") -----
Base constructor called on the sly
ChildClass1 constructor called

------- ChildClass2("Three") ---
Base constructor called on the sly
ChildClass2 constructor called

There is an implicit call to super() in the first line of the constructor for ChildClass2. HTH