Win a copy of Kotlin for Android App Development this week in the Kotlin forum!

Rinku Mishra

+ Follow
since Feb 27, 2008
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 Rinku Mishra

Hi Sagar,

Thank you for your reply.
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) {}
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..
10 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
7 answer
Thanks everybody for your replies .This is indeed a good forum
I found this in a leading Java text book.
Runnable are = new Runnable();;// 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.

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.


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