Jenny Hua

Greenhorn
+ Follow
since Jul 24, 2001
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 Jenny Hua

http://www.geocities.com/skmajji/Main.html
question #5:
The following code will print
1: int i = 1;
2: i <<= 31;<br /> 3: i >>= 31;
4: i >>= 1;
5:
6: int j = 1;
7: j >>= 31;
8: j >>= 31;
9:
10: System.out.println("i = " +i );
11: System.out.println("j = " +j);
A) i = 1
j = 1
B) i = -1
j = 1
C) i = 1
j = -1
D) i = -1
j = 0
why the answer is D? thanks in advance . I think i should be 0.
Thank you very much, Jane!
17 years ago
in MindQ's mock test: http://www.javaranch.com/maha/_Mock_Exams/MindQ_s_Sun_Certified_Java_Programmer_Practice_Test.htm
question #35:
class Super
{ int index = 5;
public void printVal()
{ System.out.println( "Super" );
}
}
class Sub extends Super
{ int index = 2;
public void printVal()
{ System.out.println( "Sub" );
}
}
public class Runner
{ public static void main( String argv[] )
{ Super sup = new Sub();
System.out.print( sup.index + "," );
sup.printVal();
}
}
The answer is :
The code compiles and "5, Sub" is printed to standard output.
I just don't understand why 1 value comes from super, the other comes from sub?? thank you in advance !!
17 years ago
in JavaCaps mock test (Title-10): http://www.javacaps.com/scjp_util.html
question #2.Which of the following allows duplicates , and introduces positional indexing.?
[a] Set
[b] Map
[c] Iterator
[d] List
To my surprise, the answer is b?! As I remember, Map doesnot allow duplicates in the collection, right?
who can help me to clear this?? Many thanks in advance!
17 years ago
in javaprepare mock test: http://www.javaprepare.com/quests/awt_q.html
question#5: Which classes can be added to a Frame component.
The answer doesn't include Menu, why ? as Frame definition, Frames have title bars, icons, and menus.
Thank you in advance!
17 years ago
in Marcus Green mock test#1 http://www.jchq.net/mockexams/exam1.htm#Question%2030)
Question #30
public class MyClass1 {
public static void main(String argv[]){ }
/*Modifier at XX */ class MyInner {}
}
What modifiers would be legal at XX in the above code?
1) public
2) private
3) static
4) friend
ANSWER is 1, 2, 3. I am confused, in this case, outer class is public already, can inner class be public also?
Please help me out. thanks!