Jyotsna Umesh

Ranch Hand
+ Follow
since May 09, 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 Jyotsna Umesh

Hi everybody,
I thank all the Javaranchers who cleared my doubts and helped me in focussing for this test. I realy feel this site is too good for all those aspirants who want to take this test.
I got approx. eight to ten questions from IO and somewhat same no from thread so these two subjects are very important. Overloading, overriding questions were simple and logical but util and thread were really confusing stuff. overall the paper was tougher than marcus mock test and many other mock test that I did.
But I am happy to clear it since I didn't have OOPs and Java programming background, I just did hard work and attempted many mock tests.
all the best. Thanks to everybody once aain.
Regards,
Jyotsna
22 years ago
Select the rght answer?
Which of the following statements about event handling in JDK 1.1 and later are true?
a) A class can implement multiple listener interfaces
b) If a class implements a listener interface, it only has to overload the methods it uses
c) All of the MouseMotionAdapter class methods have a void return type.
I think a and b should be right. Please check if I am wrong.
Regards
Jyotsna
Hi Friends,
Thi is a question from MindQ mock exam.
Which of the following describe the sequence of method calls that result in a component being redrawn?
a) invoke paint() directly
b) invoke update which calls paint()
c) invoke repaint() which invokes update(), which in turn invokes paint()
d) invoke repaint() which invokes paint directly
I think option c is right. Please confirm.
and also when I click link to see answer key, the link doesn't work and takes me to Javaranch site. Please suggest how to check answer key.
Regards
Jyotsna

Originally posted by Thomas Paul:
Notice this statement:
first = new String(args[0]);
first is a completely different object then the String at args[0]. This statement is creating a second String object.


Thanks Thomas,
if the line was
first=args[0]; then I guess option c was the right choice, isn't it.
Thanks in advance
Jyotsna
Hi Friends,
Please read a quesion from mock exam.
You have to select when object first is eligible for garbage collection?
class Riddle {
public static void main(String[] args) {
String first, second;
String riddle;
if (args.length < 2)
return; a: first = new String(args[0]);
b: second = new String(args[1]);
c: riddle = "When is a " + first;
d: first = null;
e: riddle += " like a " + second + "?";
f: second = null;
g: System.out.println(riddle);
h: args[0] = null;
i: args[1] = null;
j:
}
}
Select the one right answer.

a. d:
b. e:
c. h:
d. i:
e. j:
The ans. given is a but I think it should be c as the object first can still be referenced by args[0].
Even after reading about GC a lot, I still fail to understnad some questions. Please help to clear this question's doubt.
Thanks
Jyotsna
hi friends,
A quetsion from mock exam!
What modes are legal for creating a new RandomAccessFile object?
Select all valid answers.
a. "w"
b. "r"
c. "x"
d. "rw"
e. "xrw"

The ans. given is b and d , I know these two are the valid modes but the question says "... for creating a NEW randomaccess file" that means only "rw" mode is valid otherwise mode "r" will give "FileNotFound" Exception. Isn't it?
SO right ans. should be only d.
Please confirm!
Jyotsna
Select all valid answers.
Hi friends,
its a question from mock exam.
Select all valid statements.
a. You can directly free the memory allocated by an object.
b. you can directly run the garbage collector whenever you want to.
c. The garbage collector informs your object when it is about to be garbage collected.
d. The garbage collector reclaims an object�s memory as soon as it becomes a candidate for garbage collection.
e.The garbage collector runs in low-memory situations.
The. ans given is c d and e. Why d option is right? The word "as soon as " actually makes it false, its never guaranteed when gc will reclaim object's memory.
any comments?
Thanks
Jyotsna

Originally posted by jim d:
if they r deprecated then dont choose them


hi,
but in the mock exam they have chosen deprecated methods as well.
so ???
Jyotsna
Thanks Dave for providing relevant info.
Jyotsna

Originally posted by Dave Vick:
Jyotsna
I think 4 is just worded so that it sounds like a good answer. wait() realy doesn't have anthig to do wiht synchronized objects specifically (you can call wait on any thread, regarless of wehter or not its in synchronized code). It's just that usually wait is used within the synchronized code to control access. when you call wait on a thread it just stops and waits. It doesn't do anything else. If it was in synchronozed code it'll release the lock on the monitor but it doesn't do anything to or with any other objects.
Dave
If I'm wrong on anything here someone please corect me.


Thanks Dave, maybe the option sounded like a good ans. to me, so got confused.
Jyotsna
Hi Friends,
In such questions should deprecated methods also be selected as right options?
Which methods may cause a thread to stop executing?
sleep();
stop();
yield();
wait();
notify();
notifyAll()
synchronized()
Select all correct answers
Thanks
Jyotsna

[This message has been edited by Jyotsna Umesh (edited June 28, 2001).]
Hi Friends,
The obvious ans. to the code is 2 but I fail to understand why option 4 is wrong?
What is the effect of issuing a wait() method on an object
1. If a notify() method has already been sent to that object then it has no effect
2. The object issuing the call to wait() will halt until another object sends a notify() or notifyAll() method
3. An exception will be raised
4. The object issuing the call to wait() will be automatically synchronized with any other objects using the receiving object.
Thanks
Jyotsna

Hi Friends,
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 output.
F> Nothing will happen.
Select the most appropriate answer.
The ans. given is D. I agree with it but resume() method should also play its part and hence E ption should be the ans.
Please correct me if I am wrong.
Jyotsna

Hi Friends,
Given the following sequence of Java statements
1. StringBuffer sb = new StringBuffer("abc");
2. String s = new String("abc");
3. sb.append("def");
4. s.append("def");
5. sb.insert(1, "zzz");
6. s.concat(sb);
7. s.trim();

Which of the following statements are true:

The compiler would generate an error for line 1.
The compiler would generate an error for line 2.
The compiler would generate an error for line 3.
The compiler would generate an error for line 4.
The compiler would generate an error for line 5.
The compiler would generate an error for line 6.
The compiler would generate an error for line 7.

The ans. is 4 and 6 , why not 7 also, trim() also results in new string, isn't it?
Thanks in advance
Jyotsna

Originally posted by Cindy Glass:
You ask this in a public forum with Paul Anil lurking about ? Sortta loads the chances for a positive answer doesn't it?
I have heard GREAT things about that exam.


Hi Cindy,
Your ans. really made me laugh. Thanks anyway
Jyotsna