Wei Du

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

Recent posts by Wei Du

Hi. Yan Bai. I started to prepare for SCJP2 1.2 in Feb.2002 and passed the 1.4 Beta in May. The material covered in 1.4 is the same as 1.2 except the following: 1.4 took out AWT and I/O but added Assertion. As far as difficulty, it's almost the same from what I saw in the 1.4 beta test.
Good luck!
I took the 1.4 Beta in May and may have to take the official 1.4 when it comes out if I fails the beta(I heard people say some time this summer).
The 1.2 voucher I bought back in May can be used for whatever test that Sun offers. You can confirm that from Sun Education.
I would wait for the 1.4 test intead of taking the current 1.2. For one thing, you don't want to obtain a certification that immediately becomes obslete.
Best of luck,
Just got of the 4 long hours of Beta test. Since I read the postings on this thread, there wasn't any big surprises. I want to comment on the number and difficulty of the GC questions.Believe me, they ARE time-consuming and hard. I just glanced over some of them and guessed, since I don't want to run out of time. I should point out, GC has been my weak area.
Overall, the questions were better than a typical mock exam. Some were very easy that takes < 5 seconds while others require the reading of a long code. You should try to average 1.5 questions/minutes. Don't spend too much time on the very unfamiliar ones, if you run out of time, you might miss some easy ones.
I finished the test with 3 minutes on the clock so I didn't have much time to double check.
I found 2 questions where it says to pick 3 (or 2) correct ones and I could only find 2 (or 1). I did comment on that.
Without AWT and I/O, the questions focused more on the core Java knowledge. Since I don't use AWT at work and I haven't spend any time studying it, I will definitely wait for the official 1.4 test if I fail the beta,
In Boone's mock exam, asin() was shown to be a valid math method. Is that true?
Thanks to all who participated in the discussion. Corey's reply cleared the confusion in my mind as toString() doesn't create a String literal, just a String object, thus String literal pool doesn't apply here.
Corey: thanks for the quick reply. I was thinking about the fact that JVM uses the "object pool" concept on String that it doesn't create a new String obect when it detects there is already one in the pool.
I guess toString() was implemented to always create a new String object instead of following the "String Pool" idea.

I don't understand why the result is "False". I think on both side of == , the references both point to the same object, which is 127. Can someone explain?
In Manish's notes:

The methods sleep() and yield() are static methods of the thead class, they ALWAYS work on the thread from which they are invoked.



I thought sleep() and yield() alway work on the currently running thread, may or may not be the thread from which they are invoked (called). Is that right?
I will be pretty upset if I see this kind of question on the real exam.
Shura Balaganov's method only works if the number in question is close to the boundaries. 2's complement is a standard way, and in my opion, very efficient way to solve this kind of questions.
I did try to use the instantiated object inner to access the variables as Corey showed in the posting. It still complaints at:
hashTemp = makeHash("start");
Corey: did you have to do anything else to make it compile and run besides what you showed in the main ?
I should point out, the inner class myHash is enclosed in makeHash method. Its purpose is to return a Hashtable object containing a subset of names and keys derived from the original Hashtable. In this case, the new Hashtable only contains key-name pairs where the names start with "start".
Providing accessors is worth a try. Thanks.
I tried to use "a Local Inner Class Example" in Bill Brodgen's "Java 2 Exam Cram" book. The code won't compile "as is", saying "can't make a static reference to a non-static variable...". I could make the two String array variables static, plus make the method makeHash() also static, which compile and run just fine. But what else can I do to make it work without making the variables static? Any other sugguestions on making it more OO will be helpful too.
Just want to add something to the first question. B and C can't possibly be true because the scope of locale variable sName in Pigg() method, it doesn't change the sName of t object. For more info on related subject, see the following thread:
https://coderanch.com/t/237705/java-programmer-SCJP/certification/StringBuffer
Thanks to those who responded. I quote JLS:
"If a class declares a static method, then the declaration of that method is said to hide any and all methods with the same signature in the superclasses and superinterfaces of the class that would otherwise be accessible to code in the class. A compile-time error occurs if a static method hides an instance method".