Vinny Chun

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

Recent posts by Vinny Chun

First of all, I would like to thank every Racnhers for their contribution and support. Without your help, I wouldn��t think it was possible for me to learn and pass the programmer exam in such a short time.
I have to be honest with you. Even though I had done many mock exams, I didn��t get a good score from them. I always get around 50%-60% and it definitely weakened my confidence. I was quite nervous one week prior the exam! Fortunately, I read the posts from the Programmer Certification Results forum and found out that the mock exams were a bit tougher than the actual exam. Then I felt a little bit better.
One good advice for the exam is to stay cool. When you read the question and don��t understand it, read twice. Some wordings are quite tricky and you have to pay attention to these. For example, they may show you codes that extends that class and implements that interface. But in fact, the question is testing your knowledge in using access modifiers. So, clear you mind and don��t over complicate the question. With my exam, the questions were evenly distributed: several in declaration, several in thread, several in awt and event and several in io. One area that I didn��t do well was in GC! Another advice for the people who will take the SCJP exam, please try to do as many mock exams as possible. These exams can identify which area you need to put more efforts into prior the exam.
For me, the SCJP exam is conquered. Now, the Web Component Exam is next! Good luck to all of you!
22 years ago
Manfred, your explanation is billiant. However, I have never thought that I could call a static method just like the example! Do we really need to know these kinds of tricky method calling in the exam? I am very nervous!
Dave and Val, thanks for your explanation. I am more clear with this For Loop now.
Testing the indent
<&>class Question
{
public static void main(String[] args)
}
</&>
I came across a tricky question in the Net.
class Question
{
public static void main(String[] args)
{
int i, j;
for (i=0, j=0; i+j < 20; ++i, j+=i--)
{
System.out.println("i+j = " + (i+j));
}
}
}
What does this program print out?
a.5
b.8
c.13
d.Compile error
Answer a, b and c are correct.
William, thanks for your reply.
If I have problem in understanding your materials in the future, I will definitely write to you instead. Thanks again.
Jose, thanks for your explanation.
However, one more simple question, how can I indent my code in this forum? I just copy and paste the code to the Reply box, however, all the tabs are disappeared. I hate to see un-indented codes too! Please help!
One question from "The Hardest Questions Simulation 19 Qtns" from Bill Brogden. Given the following class definition:
public class DerivedDemo extends Demo
{
int M, N, L;
public DerivedDemo(int x, int y)
{
M=x; N=y;
}
public DerivedDemo(int x)
{
syper(x);
}
}
Which of the following constructor signatures MUST exist in the Demo class for DerivedDemo to compile conrrectly?
a. public Demo(int a, int b)
b. public Demo(int c)
c. public Demo()
Answer b seems a very obvious choice. However, Answer C is also required. And here is the explanation: "Answer C is required because a default(no arguments) constructor is needed to compile the constructor starting in Line 3."
I have problem of understanding this explanation. Shouldn't the public Demo(int c) constructor satisfy the requirement already?
public class Outer
{
int Age;
}
public class Wrapper
{
private int Age = 10;
public Wrapper()
{
final int Age = 20;//need access
class Inner extends Outer
{
private int Age = 30;
public Inner()
{
System.out.println("Wrapper Age = " + Wrapper.this.Age);
System.out.println("Wrapper Construct Age = " + ???.Age);//the variable name
System.out.println("Inner Age = " + Age);
System.out.println("Outer Age = " + super.Age);
}
}
Inner myInner = new Inner();
}

public static void main(String[] args)
{
Wrapper myApp = new Wrapper();
}
}
If there are four variables with the same name but in a different location, how do I access to the Age in the Wrapper Constructor? Thanks!
I seldomly saw any question in this forum about Event handling. Do I need to understand this topic very well? Does it occupy a lot of portion in the exam? I have difficulty in memorising this topic. Please help!
Thanks, Valentin. Your explanation is simple and clear!
I know this is a silly question. However, I forgot how to convert a negative decimal to a binary. If there any web site on this topic, thanks!
Anand, thanks for your explanation. I understand this now.
Here is a question from the Exam Cram by B.Brogden.
In the following code for a class in which methoda has an inner class, which variables would the statement in line 8 be able to use in place of XX? (Check all correct answers)
public class Base
{
private static final int ID = 3;
private String name;
public void methodA(final int nn)
{
int serialN = 11;
class Inner
{
void showResult()
{
System.out.println("ResultID = " + XX);
}
}
new Inner().showResult();
}
}
a.The int ID in line 2
b.The String in line 3
c.The int nn in line 4
d.The int serialN in line 5
The answers are a, b and c.
According to exam cram: "Local inner classes and anonymous classes can refer to local variables only if they are declared final.". Answer a and c fulfill this rule. However, why does it allow to access to the String in line 3? Please explain.
Here is another similar question:
Read the code below. Will be the result of attempting to compile and run the code below.
public class AQuestion
{
public void method(StringBuffer sb)
{
System.out.println("StringBuffer Verion");
}
public void method(String s)
{
System.out.println("String Version");
}
public static void main(String args[])
{
AQuestion question = new AQuestion();
question.method(null);
}
}
Answers
1.The code does not compile.
2.The code compiles cleanly and shows "StringBuffer Version".
3.The code compiles cleanly and shows "String Version"
4.The code throws an Exception at Runtime.
Now, this time is Answer 1!! :-(