Rinku Mishra

Greenhorn
+ Follow
since Feb 27, 2008
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Rinku Mishra

Hi Sagar,

Thank you for your reply.
Hi,
could anyone please tell me what is a daemon thread and how to recognize it?
The example given below contains daemon thread.Can anyone elaborate on this
and explain a bit clearly.
And when do we use daemon thread?


class A extends Thread {
private Object obj;
public A(Object obj) {this.obj = obj;}
public void run() {
try {
synchronized (obj) {obj.wait();}
} catch (InterruptedException ie) {}
System.out.print(Thread.currentThread().getName());
}}
class B {
private void m1() {
for (int i = 0; i < 10; i++) {
A t1 = new A(this);
t1.setName(String.valueOf(i)); t1.setDaemon(true); t1.start();
}
synchronized (this) {notifyAll();}
}
public static void main(String[] args) {new B().m1();}
}
congratulations..!! ..indeed a good score..
9 years ago
What is put on screen?static public void main(String...arg) { int i=1; int result = 5+i++%4*i; System.out.println(result); }


hi Kshitija,

I think 7 is the right answer,because
I think this is what happens
5 + 1%4 * 2 [here 5 + (i(which is 1 first because of postincremnet)%4 gives 1)*i(which is 2 right after the increment)]
so here it goes like this
5 + 1*2
5+2
7 answer
Thanks everybody for your replies .This is indeed a good forum
Hi,
I found this in a leading Java text book.
Runnable are = new Runnable();
are.run();// Legal but does not start a separate thread.


My question is how can we instantiate an interface which is always 100% abstract although I know that in case of annonymous classes we can use the phase "new Runnable", but that is different.

Here Runnable is an interface and not defined in an annonymous class but still the new keyword is used to instantiate it,but how ? and how can this be legal ?
I am a bit confused ,can anybody be kind enough to explain this to me.
Hello,

I am planning to appear for SCJA in next month.
I am ok with with the JAVA part, but confused regarding J2EE, J2ME, Server & Client technology.
Can anyone of you help me how can I get SCJA book by Cameron as soon as possible?
I am staying in Netherlands.

Thanks.
Priyanka

[ March 18, 2008: Message edited by: Bear Bibeault ]
[ May 09, 2008: Message edited by: Priyanka Roy ]