lauren bai

Greenhorn
+ Follow
since Apr 08, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by lauren bai

It's a little trick because if you use add with a position it will be wrong..


I don't know why you change the position since it's not the question said

in the order they were added (first in first out)



Rupak:
I saw you implemented java.lang.Comparable which only has one method compareTo(T o) and doesn't have equal method.
I thought you may want to implement java.util.Comparator which has methods compare(T o1, T o2) and equals(Object obj).

I don't know if this the reason you can't get expected result since I don't have JAVA 5.0 to run.
Kannan Raju: Can you give me the Dan's website?

Thanks

I also think B is right and have no idea about E.
Is inline machine-code is a test object for SCJP?
I change 1 line from you code and got "100" output.

class MyClass{
public static void main(String []args) {
int i = 100;
byte b = (byte)i;
System.out.println(b);
}
}



But I don't know why?

[ April 17, 2005: Message edited by: lauren bai ]
[ April 17, 2005: Message edited by: lauren bai ]
I write a class and want to print character "PI".

class test {
public static main(String args[]) {
char c = '\u03c0';
System.out.print(c);
}
}

Output: ?

I don't know why I get "?" instead of the character "PI".

Thank you in advance.
Thanks.

To me. 59% is high enough.
Hi,Marc, you are so right. I even didn't notice that.
I study 1.5 API but run on 1.4.
Thanks Joyce! The conception now is cleared.


I wrote nonsense code.

Thread-1, 5 and main represent the thread's name, priority and thread group respectively.



Thank you, Joyce. I just want to know the run method in my class overrides the run method in Threads or Runnable class?
I create a class as follows:

class DoubletoHexString {

public static void main(String[] args) {

Double a = new Double(Double.NaN);

System.out.println("a: " + a.doubleValue());
System.out.println("doubletoHexString: " + Double.toHexString(a.doubleValue()));
}
}



I got compile error
DoubletoHexString.java:8: cannot resolve symbol
symbol : method toHexString (double)
location: class java.lang.Double
System.out.println("doubletoHexString: " + Double.toHexString(a.doubleValue()));


I check my spelling is correct. Can anybody tell why it's not correct?
[ April 14, 2005: Message edited by: lauren bai ]
Inspried by M Rama, I also write a class. I don't know if it's illegal.

public class StartInThreadAndRunable extends Thread implements Runnable {
StartInThreadAndRunable(){
}

StartInThreadAndRunable(Runnable r) {
super(r);
}

public void run() {
System.out.println("Thread or Runnable?" + this);
}

public static void main(String[] args) {
Runnable r = new StartInThreadAndRunable();
Thread t2 = new StartInThreadAndRunable(r);
t2.start();
}
}
Output: Thread or Runnable? Thread[Thread-1,5,main]



I want to know what's Thread[Thread-1,5,main] mean?

SUN will never unrecognized any certified candidates.



Then the certificate will never expire? I know some certificate only valid for 2 or 3 years.
Thanks Raghu! You explaination make me understood finnally.
I thought the 5 lowest-order bits of the right-hand operand and & 0x1f is the point.
Yes,Paulo. It should be 270 >> 1?

Thanks for everyone who give me help. I like this place now.

The >> operator only works on the number of bits in the primitive type. Because 270 is an int it only has 32 bits. The shift value is modded by 32 (shift%32).



Steven, thank you. I understand a little bit now. use int as example, does this mean if any number larger than 32 will be modded. i.e 64 will be equal to 0, so don't shift a bit.
Why doesn't it give a compile error to say that you can't shift more bits than the primitive type has? Who does this mod for us, JVM?

[ April 12, 2005: Message edited by: lauren bai ]
[ April 12, 2005: Message edited by: lauren bai ]