Parimala Somasundaram

Ranch Hand
+ Follow
since Mar 31, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Parimala Somasundaram

I took the exam and passed it on 5/3/01. I too thought that 2 weeks should be enough time to receive the certificate but have not got it.
Please tell me what this galton.com is. I tried going to that website, but am getting error.
How do I contact Sun about my certificate?
Thanks.
Parimala.
23 years ago
Thanks, Kish!
Thanks, Smartboy!
I scored only 71% in Threads. I am not surprised!
Yes, there were a couple of long code exhibits with synchronised code. The questions were quite balanced covering all areas equally. I think one needs to pay a lot of attention to threads, I/O, AWT. I found quite a few questions in overloading and overriding, with many questions having code that will fail to compile.
Good Luck!
Parimala.
24 years ago
I think you are ready.
When I took the JQ+ tests I was getting about 70% to 75%. In the random test I scored 80%.
Goog Luck!
Parimala.
24 years ago
Hello everyone,
At last, I got the courage to take the exam and passed it with 89%.
Thanks to all of you for you help in answering my questions. Thanks to JQ+! I had signed up for the exam for April 27th. I heard about JQ+ on the 24th in this forum. I rescheduled my exam for the 3rd(yesterday) and got JQ+ and went thru the pracrice tests. It helped a lot. I found that many questions on the exam were similar to the ones in JQ+.
Good luck to everyone who plans to take the exam!
Parimala.
24 years ago
Thanks Manfred, Jini.
You are given the class file for a class called Secret. However, you do not have the source code or any information about the internals of the Secret class. You do know that the class has a protected int variable called i. What does the following application print out?
1. class Mine extends Secret {
2. public static void main(String[] args) {
3. Mine m1 = new Mine(); m1.i = 5;
4. Mine m2 = new Mine(); m1.i = 5;
5. if (m1.equals(m2))
6. System.out.println("YES");
7. else
8. System.out.println("NO");
9. }
10. }
A. Yes
B. No
C. Impossible to know
Correct answer is C. The result of the call to equals() on line 5 depends on how the method was written in the Secret superclass.
Can someone please explain?

Originally posted by Stevie Kaligis:
[B]System.out.println('2'+3+"");
will be evaluate : (('2'+3)+"")
1. ('2'+3) convert to integer,
2. ((50 + 3) + "")
output : 53
System.out.println( '2'+'3'+"");
will be evaluate : (('2'+'3')+"")
1. ('2'+'3') convert to integer,
2. ((50 + 51) + "")
output : 101
Stevie:
Could you please explain how '2' in char evaluates to 50 in int?
Thanks.

Hello Thiru.
I think Nan sh is refering to the book
Complete Java 2 Certification Study Guide
by
Simon Roberts, Philip Heller and Michael Ernest.
The book comes with a CD that has 4 mock exams called bonus1, bonus2, bonus3 and Final. Each has 50 questions. I too found this book and CD very useful. Only the second edition has the bonus questions, I think.
Parimala.
I want to register at JQplus. I tried but cannot get to the website. It gives error message.
http://enthuware.com/jqplus/
Is this the right web address?
Thankyou.
I know that static methods cannot be overridden by non-static methods. And also, non-static methods cannot be overridden by static methods.
But, can static methods be overridden by static methods?
What is the effect of compiling the following code and then executing the 'Child' application?
1. public class Papa {
2. int i;
3. Papa(int j) {i=j;}
4. }
5.
6. class Child extends Papa {
7. Child() {i=5;}
8. public static void main(String[] args) {
9. new Child();
10. }
11. }
A. Compiler error at line 6.
B. Compiler error at line 7.
C. Compiler error at line 9.
D. The code compiles but throws exception when the application is executed.
E. The code compiles and executes with no problems.
The answer is B. I can understand this. Since 'Papa' has non-default constructor, it does not get a no-parameter constructor at compile time. So line 7 will not compile, as the compile tries to call its superclass default constructor.
My question is: Will it compile if line 7 was:
Child(int k) { // do something
}
Does the compiler try to call the superclass no-parameter constructor only if the Child class has a no-parameter constructor?
The correct answer to this Q is B. Is it because text is declared as private? I don't understand.
The following code defines a simple applet:
import java.applet.Applet;
import java.awt.*;

public class Sample extends Applet {
private String text = "Hello World";
public void init() {
add(new Label(text));
}
public Sample (String string) {
text = string;
}
}

It is accessed form the following HTML page:

<html>
<title>Sample Applet</title>
<body>
<applet code="Sample.class" width=200 height=200></applet>
</body>
</html>

What is the result of compiling and running this applet:
A. Prints "Hello World".
B. Generates a runtime error.
C. Does nothing.
D. Generates a compile time error.
Select the most appropriate answer.

The correct answer to the following Q is d). Should it not be e)?
What is the result of compiling and executing the following Java class:
public class ThreadTest extends Thread {
public void run() {
System.out.println("In run");
suspend();
resume();
System.out.println("Leaving run");
}

public static void main(String args []) {
(new ThreadTest()).start();
}
}

a) Compilation will fail in the method main.
b) Compilation will fail in the method run.
c) A warning will be generated for method run.
d) The string "In run" will be printed to standard out.
e) Both strings will be printed to standard out.
f) Nothing will happen.
Select the most appropriate answer.
Q3.
Since the value of flag is set to false, the sample() method should not execute. Is this not true?