Wendy Lum

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

Recent posts by Wendy Lum

Problem Solved. I didn't notice the different seperators used in windows and unix in classpath. Yes, I am not an experienced java programmer, but I am learning. Ok? Thank you anyway.
Hi,
I am reading the HFSJ book (chapter 3, page 84-85) and come into a compile trouble when I tried to compile the servlet which calls a method of a model class. I created the directory exactly as what is said in the book and I created the model class (BeerExpert.java) in package com.example.model and it compiles.

But when I modified the servlet to import com.example.model.* to call the getBrands() method of class BeerExpert which I already compiled, the compiler gave errors saying that it couldn't find the com.example.model package.

Can anyone help me out? I have checked everything and I don't have any clue. Thanks for your help in advance.
Hi,
Anyone knows where to get a class hierarchy diagram of all java classes? I want to print one out and check their relationship easily. Thank you in advance!
19 years ago
Congratulations!
19 years ago
Congratulations!!
19 years ago
Hi, all,

I took the exam today and passed with 96% (59/61).

I should say thanks to all of you especially the authors of my favorite book, Kathy Siera and Bert Bates. And thanks to Marcus Green and Dan Chisholm for their great mock exams.

Good luck to all of you who will take the exam soon!!
19 years ago

Originally posted by Mani vannan:
Which edition of the book read? Checkout. It might be little old.


It's published in 2003 for SCJP 1.4. I think it's the new one because I just bought it about one month ago.
In java documentation, the join() method throws an InterruptedException just like sleep() and wait(). But why in the examples of K&B's book, they never put join() inside a try/catch block and they didn't mention the InterruptedException join() throws at all? I tried it on my compiler and it said join() must be in try/catch block. Please let me know if I missed anything. Thank you!

Originally posted by Cheenu Subramanian:
Ya Wendy.. U r right..

Float f=new Float("0x1") doesnt work.. Any idea ..why?


I don't know why. Just try to memorize it.
[ November 24, 2005: Message edited by: Wendy Lum ]

Originally posted by Cheenu Subramanian:
I assume the string parameter to the Float constructor has to be a valid number and not something like 1D or 1D or 1F. Even 1f doesnt work for me..Correct me if I am wrong



Float ff=new Float("1f");
Float ff1=new Float(1f);

Work fine here.
I tried this code and it gave run-time error, too:

Long ll=new Long("1L");

It seems "1L" can't be passed as the string parameter to all primitive wrapper constructors.

Originally posted by Steve Morrow:

Maybe I'm misunderstanding you, but the JLS specifies that the five lowest bits are used of the shift operand to determine the shift distance for int values (note that the six lowest bits are used for long values).


I got the idea now. Thank you all!

Originally posted by Surekha Reddy:
Hi,

Lets take this example.

int i = 10;
i = i << 35;

here 35 is not in the range of 0 to 31. So we can use lower 5 bits to calculate the shift distance.

35 -- 0000 0000 0000 0000 0000 0000 0010 0011

Here lower 5 bits are -- 00011. This is 3 in decimal.

This means i = i << 35 is equivalant to i = i << 3.

Please correct me if i'm wrong.

Regards,
Surekha.



I think it should be:
i = i << 35; ---> i = i << (35%32); ---> i = i << 3;

There's nothing with the 5 lowest bits. Let me know if I am wrong. Thanks.

Originally posted by Henry Wong:


And when it is not, only the lowest 5 bits are used to get it into that range.

Henry



Can you give an example for this? Thank you.