Divya Eknath

+ Follow
since Jul 27, 2006
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Divya Eknath

Thankyou very much to ranchers.I studied from K&B & Khalid Mughal.I found the Dan's mock tests very useful.I think we need a lot of practice solving different types of questions from mock exams on each topic in order to understand the topic well.Anyway i am glad that my journey to SCJP is over.
17 years ago
ppp sup = new ppp();
ppp.aaa sub = sup.new aaa(){};

The abstract inner class's mmm() method cannot be called directly as abstract classes cannot be instantiated.You can extend the abstract inner class and call the method using the object reference of the subclass.
I am confused about the unreachable statements in java.It is said that to place assertions at the place which is unreachable is a good practice, but then again if assert statement is unreachable it gices compile-time error.I referred to JLS to understand the concept of unreachable statements, but sadly i don't have enough time to go through and understand everything as i have exam in few hours
Can anybody please tell me the precedence of bitwise/ligical operators:&,^ and |?
In some books its given as & ^ |, while in others it is & | ^.
I ran the program below and got option(C) as the output but is this the only possible output?Are the thread priorities guaranteed to be considered?

What are the possible outputs of above program?
a) A Done
b) B Done
c) A Done B Done
d) B Done A Done
e) java doesnt support this type....
[ July 29, 2006: Message edited by: Barry Gaunt ]
which of the following line causes a compiler error?

public static void main(String[] args)
assert false;
assert false;
public static void method()
assert false;
assert false;
What is the use of having timeout argument for the wait() method?
If i understand correctly, both when the
(1)thread is notifiied and when the
(2)time in the wait method expires,
the thread goes to Blocked-for-lock acquisition state.And when the lock on the object is released it goes to ready-to-run state and then to running state whenever it gets chance.

So the call to wait() method returns at the same time in both cases.

And also when the thread is interrupted, does the thread go to Blocked-for-lock acquisition state-->>Ready State-->>Running annd then throws the InterruptedException.Please correct me if i am wrong.
class B{}
class A{

private int x;
private int y;

public synchronized void amethod(){


public void bmethod(){
B b = new B();


public void setValues(){


My question is if the synchronized method, amethod()uses a private variable of the class, then is it ok for other threads executing the synchronized block and the setValues methods to access the same variable and change its value?