xing wu

+ Follow
since May 14, 2002
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 xing wu

Congrats, Bill!
21 years ago
Thanks Perseus and Valentin I am planning to take my certification to the next level. I'd like to get the architect certification. Would it be a good idea if I take it directly and skip the SCWD? I have 2 project lead experience using OOAD, UML, patterns, & requirements analysis and 4 projects using jsp/serlvets and 1 using EJB. I would appreciate any insights/suggestions from you. Thanks!
21 years ago
I just hurdled the SCJP 1.4 exam Sept 30 and got 70% rating. I've been coding in Java for about 2 years now. My exam preparation had been on and off as I do my review in between projects. Sometimes I have a month of review then there's a 6 months log due to projects. I only had 2 weeks intensive review and about a week for the mock exams before the taking the actual exam.
The questions were not that tough, as compared to Dan Chrisholm's mock exams, except for Threads, Garbage Collection, and a mixture of Threads with Inner Classes.
I used Roberts and Mughal's certification books for review. For mock exams, I concentrated using Dan Chrisholm's as it's the most updated for the 1.4 version. For other mock,I only tried a few as they are not that updated for the 1.4 version.
Thanks to JavaRanch folks for your insights. This site was really of big help.
21 years ago
All data members of a class that implements Serializable are serialized, except transient and static. Declaring a member variable as both transient and static is redundant. As such, transient modifiers should not be specified for static variables.

So I guess final or static specifiers are immaterial.

Yes, I agree. Transient has meaning only in relation to serializing an object's state. For the sake of consistency in it's intent, wouldn't it be a good idea that Java should not allow such syntax? (Just wondering)
I agree with Ron.
Manish Hatwalne shares the principle in his interesting article on Equals and Hash Code. He wrote :

Equal objects must produce the same hash code as long as they are equal, however unequal objects need not produce distinct hash codes.

Here's the question:

The following declaration(as a member variable) is correct or not?.
static final transient int maxElements = 100;
A) It's correct.
B) It's not correct.

My answer is B. As I understand it, transient modifer should not be specified for static variables, as these do not belong to objects.
Thanks for your enlightenment.
I just updated my display name.
I'm still using SDK1.2 compiler though. I'll try the higher versions. Thanks for your comments.
22 years ago
Accdg. to one of my SCJP certification books " if an instance initializer block does not catch a checked exception that can occur during its execution, then the exception must be declared in the throws clause of every constructor in the class".
However, I tried coding it below and the compiler wont allow me to throw a checked exception :
class MyException extends Exception{
public MyException(String msg) { super(msg); }
public class MainClass {
public static void main(String args[]){
try {
new InitBlock();
}catch(MyException e){}
class InitBlock{
boolean test;
test = true;
if(test) throw new MyException("throw...");
InitBlock() throws MyException {
Thanks for your help. This is my first posting
22 years ago