Susie Chow

Ranch Hand
+ Follow
since Jun 12, 2001
Merit badge: grant badges
For More
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 Susie Chow

I just wanna get a general idea of the salary because I have been researching online and I don't see a very specific salary survey for SCJP while I see some for MSCE, etc. I am in San Francisco. I have a Master of Sicence Degree in Computer Information System and about about 2.5 years industrial experience.
Thanks for your comments.
21 years ago
What would you say about the salary of a SCJP?
21 years ago
Thanks, Ankush. I am going to take the exam on Wednesday too. Good luck to you.
Another question. I thought the follow code would not compile because i is non-static, which cannot be accessed by static change_i?
Thank you.
class StaticTest3
{
int i = 0;
public static void main(String[] args)
{
int i = 1;
change_i(i);
System.out.println(i);
}
public static void change_i(int i)
{
i=2;
i*=2;
}
}
Hi, can anyone explain to me why the following prints 1? Thank you.
public static void main(String[] args)
{
boolean x = true;
int a;
if(x) a=x? 1:2;
else a=x? 3:4;
System.out.println(a);
}
Hi everyone,
I would like your comment. I want to know which mock exam is the most realistic one? My friend who took the exam and said that the final exam in the R&H book is most similar to the real exam. What do you think?
Thank you.
(++k) + (k++) + (+k) = 2+2+3
Why does (+k) = 3?
Check the API http://java.sun.com/j2se/1.3/docs/api/index.html
Checked exceptions are generally java.lang.Exception where runtimeException is a subclass of Exception. I think unchecked exception refers to java.lang.Error? Correct me if i am wrong. Thank you.
This also works
class Top {
Top(double d) {
System.out.println(d);
}
}
public class Down extends Top {
public static void main(String args[]) {
Down d= new Down(3.3);
}
Down(double d) {
super(d);
System.out.println("From down" +d);
}
}
Hope it helps.
However, I have just come across with this question. There is no compiling error when compiling the following code. RuntimeExcpetion is not a subclass of ClassNotFoundException. When I change RuntimeException to SQLException (they are all subclasses of Exception), it doesn't compile. Can anyone explain to me?
Thank you.
public class Base
{
public void aMethod() throws ClassNotFoundException{}
}
public class Derive extends Base
{
public void aMethod() throws RuntimeException{}
}
No, you can only throw the subclass of the exception that the overridden method throws.
Hi,
code #1 returns no component on the frame. However, code #2 returns a list of button in a row. Can anyone explain to me why? My thought is that code #1 will return one big button C at the center of the frame because when you add an element in borderLayout w/o specifying the location, it would add the button to center.
Thank you very much.
#1
class TestFrame extends Frame
{
Button bN = new Button("N");
Button bS = new Button("S");
Button bE = new Button("E");
Button bW = new Button("W");
Button bC = new Button("C");
public TestFrame()
{
setLayout(new FlowLayout());
add(bN);
add(bS);
add(bW);
add(bE);
add(bC);
setLayout(new BorderLayout());
validate();
setSize(300,300);
setVisible(true);
}
public static void main(String[] args)
{
TestFrame tf = new TestFrame();
}
}
#2
class TestFrame extends Frame
{
Button bN = new Button("N");
Button bS = new Button("S");
Button bE = new Button("E");
Button bW = new Button("W");
Button bC = new Button("C");
public TestFrame()
{
setLayout(new BorderLayout());
add(bN, BorderLayout.NORTH);
add(bS, BorderLayout.SOUTH);
add(bW, BorderLayout.WEST);
add(bE, BorderLayout.EAST);
add(bC, BorderLayout.CENTER);
setLayout(new FlowLayout());
validate();
setSize(300,300);
setVisible(true);
}
public static void main(String[] args)
{
TestFrame tf = new TestFrame();
}
}
Got it. Thank you.
Hi,
Why does the follow code result 1.
byte b = 0;
b += 1;
But the follow code need a cast?
byte a=0;
byte b=1;
byte c = (byte)(a+b);
Thank you.
public interface AQuestion
{
void someMethod();
}
Why is the class which implements AQuestion should have someMethod that must necessarily be public.
My thoughs is that since someMethod in AQuestion has default modifier, the overriding method could be default, protected or public?
Thank you.