Aru

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

Recent posts by Aru

Sanjeev,
Here are my answers .....
1) TextArea(String s, int rows, int columns) is one of the constructor for TextArea.
Which statement is true?
A. The displayed width shows exactly five characters on each line unless otherwise constrained. - False
B. The displayed height is five lines unless otherwise constrained. - True
C. The maximum number of characters in a line will be five. False
D. The user will be able to edit the character string. - True
E. The displayed string can use multiple fonts. - False
2.FilterInputStream is the parent class for BufferedInputStream and DataInputStream.
Which classes are a valid argument for the constructor of a FilterInputStream?
A. File
B. InputStream - True
C. OutputStream
D. FileInputStream - True
E. RandomAccessFile
3. What might cause the current thread to stop executing.
Here the catch is the word "might" So D is true.
A. An InterruptedException is thrown. - False
B. The thread executes a wait() call. - True
C. The thread constructs a new Thread. - False
D. A thread of higher priority becomes ready. - True
E. The thread executes a waitforID() call on a MediaTracker.-True
4. What is true about threads that stop executing?
A. When a running thread's suspend() method is called, then it is possible for the thread to indefinitely remain suspended.
- True... don't call resume()
B. The interpreter stops when the main method stops.
- False. not always
C. A thread "CAN" stop executing when another thread is in a runnable state. - True. (when other thread of high priority becomes ready)
Please correct me if I am wrong
Hope this helps.
Aruna
Hi Mapraputa,
Can u please give me the link to Boone�s exam.
Thx in Advance.
Aruna
Hi All,

Does JVM exits after the main() thread ?
I think it does - True.
But I found that one of the mock test says that some other threads may still be running.
How is this possible ? Can anyone explain.
Your help is appreciated.
Thx in Advance.
Aruna
Hi Ganesh,
I am unable to get in to the mock test...... can u help me.
Thanks,
Aruna
Hi Rahul,
Congratulations.....
Great Score,
Aruna
Hi Wong,
You are right, the answer should be C & E.
Aruna
Choi,
Container & menu Item can't be added to a container.
Aruna
hey Sheri,

None of the answers are correct.
Bcoz, The right hand side returns a boolean which u r assigning to a int.... Which doesnt compile.
Aruna
Yes Stephan u r right. The StringBuffer class does not override the equals method.
So using equals method with a StringBuffer always returns "false"
Aruna.
[This message has been edited by Aru (edited September 21, 2000).]
Hi All,
See this Question. I don't think the valid answers are A, D,E
only (y == z) return true.
2:Which comparisions are true for the following?
C x = new C(10L);
C y = new C(10L);
C z = y;
Long a = 10L;
int b = 10;
A:a == b
B:a == x
C:x == y
D:y == z // Only this return "True"
E:a == 10.0

To Test the above Question...I wrote the code
class C{
C(long l){}
}

class Test{
public static void main(String[]args){
C x = new C(10L);
C y = new C(10L);
C z = y;
Long a = 10L;
int b = 10;
System.out.println("a == b : "+ (a == b) );
System.out.println("a == x : "+ (a == x ));
System.out.println("x == y : "+ (x == y) );
System.out.println("y == z : "+ (y == z ));
System.out.println("a == 10.0 : " + (a == 10.0) );
}
When I executed I got the following o/p.
C:\Java\bin>javac Test.java
Test.java:23: Incompatible type for declaration. Can't convert long to java.lang.Long.
Long a = 10L;
^
Test.java:26: Incompatible type for java.lang.Long. Can't convert java.lang.Long to int.
System.out.println("a == b : "+ (a == b) );
^
Test.java:27: Incompatible type for java.lang.Long. Can't convert java.lang.Long to C.
System.out.println("a == x : "+ (a == x ));
^
Test.java:30: Incompatible type for java.lang.Long. Can't convert java.lang.Long to double.
System.out.println("a == 10.0 : " + (a == 10.0) );
^
4 errors
Do let me know if I am wrong.
Aruna
[This message has been edited by Aru (edited September 21, 2000).]
Sherin,
I compiled the prog & I got the following o/p.

Kor finally
Exception in thread "main" java.lang.NullPointerException
at Unchecked1.metod1(Unchecked1.java:36)
at Unchecked1.method(Unchecked1.java:25)
at Unchecked1.main(Unchecked1.java:20)
The finally will always be executed, except exiting the JVM.
Aruna
[This message has been edited by Aru (edited September 20, 2000).]
Sherin,
In your answer to the 2 question U said C,D,E are the right choices.
C. Invoking the suspend() stops a thread so that it cannot be restarted.
False - bcoz resume() will restart it again.
Aruna
Sherin,
Yes the answer is correct.
By making the variables - private & providing methods to access the private variables.
Aruna
Sherin,
Yes u r right, 1,3,5 are the correct answers.
Aruna
Sheri,

3 is correct bcoz....???
No Not bcoz of overriding or overloading..... it is just a different method with different name.
U can add any variable declaration, methods, any initializers, any constructor etc at //.
1. int method(int i) // Same method signature as the Base
2. public void method(String a) // Correct
3. public void anothermethod(int i) // Correct
4. void abstract othermethod(int i) // Wrong
5. void method(int i) // Same signature

But from the answers given the best choices are 2 & 3.
Hope this helps,
Aruna