srinibash udayasingh

Greenhorn
+ Follow
since Jul 09, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by srinibash udayasingh

Hi
Thanks for the reply.

But my question if Integer wraper class reference hold same value then then == returns true.Then why != also gives true.
Hi Ranchers

i unable to distinguish why all the out put is "hello".
This is example from kathy siera book

Integer x=10;
Integer y=10;
if(x==y)
System.out.println("hello");

if(x!=y)
System.out.println("hello");

if(x.equals(y))
System.out.println("hello");
Hi
still it is confuse to me.in my machine it shows 0 0 2 2 4 4 6 6.
Hi Ranchers
please explain the following codes.when i run it gives output 00224466
is it vary or same bcaz 2 thread instance created.

but options are
A 0 2 4 4 6 8 10 6
B 0 2 4 6 8 10 2 4
C 0 2 4 6 8 10 12 14
D 0 0 2 2 4 4 6 6 8 8 10 10 12 12

questions :
class Thread1
{
int x=0;
public class Runner implements Runnable
{
public void run()
{
int cur=0;
for (int i=0;i<4 ;i++ )
{
cur=x;
System.out.println(cur +" ");
x=cur+2;
}
}
};
public static void main(String[] args)
{
(new Thread1()).go();
}
public void go()
{
Runnable r1=new Runner();
(new Thread(r1)).start();
(new Thread(r1)).start();
}
}
Hi Ranchers
please explain the following codes.when i run it gives output 00224466
is it vary or same bcaz 2 thread instance created.

but options are
A 0 2 4 4 6 8 10 6
B 0 2 4 6 8 10 2 4
C 0 2 4 6 8 10 12 14
D 0 0 2 2 4 4 6 6 8 8 10 10 12 12

questions :
class Thread1
{
int x=0;
public class Runner implements Runnable
{
public void run()
{
int cur=0;
for (int i=0;i<4 ;i++ )
{
cur=x;
System.out.println(cur +" ");
x=cur+2;
}
}
};
public static void main(String[] args)
{
(new Thread1()).go();
}
public void go()
{
Runnable r1=new Runner();
(new Thread(r1)).start();
(new Thread(r1)).start();
}
}
Hi Ranchers

I am most of the time confusing generics( where wild characters are used)

can anyone help me to get clean idea about the generic topic.any tutorial on generics please.i am reading from K&B from still i am unable to understand

Regards
Srinibash
Hi Ranchers

I am most of the time confusing generics( where wild characters are used)

can anyone help me to get clean idea about the generic topic.any tutorial on generics please.

Regards
Srinibash
Hi ranchers

class NameClass
{
static String name="xyz";
static NameClass getClass1()
{
System.out.println("inside method");
return null;
}
public static void main(String[] args)
{
System.out.println(getClass1().name);
}
}

the above code prints : inside method xyz
why not null pointer exception

Regards
srinibash
Hi Ranchers
i am confuse in following code

class A
{
static{System.out.println("A");}
};
class B
{
static{System.out.println("B");}
};
class C extends B
{
static{System.out.println("C");}
};
class D
{
public static void main(String[] args)
{
C c=new C();
}
}

out put is B C
can anyone explain it..

Regards
Srinibash
Hi ranchers

I am preparing to appear the test in next week.I have read khalid mughal and Kathy Siera book.Now i want to practice using Mock Test.Can anyone tell what is free doownloadable Mock test tool and sites for online Test

Thanks and Regards
Srinibash
Hi Ranchers
i am already read the khalid mughal and kathy siera book for scjp 1.4.
now i want to give mock test for practice.Can any one tell what are available mock test tool and online practice.

thanks & Regards
Srinibash
Thank You very Much for your good explanation.Now my doubt cleared
Hello Ranchers
can any one explain the following code snipets

int []arr = {1,2,3,4};
for ( int i : arr )
{
arr[i] = 0;
}
for ( int i : arr )
{
System.out.println(i);
}

out put here is :0030
Hi Ranchers

What is need of beans.we can also create other class to get and set values.
Then what is the need of get and set methods.can please explain it using some realtime example.

Thanks

Srinibash
Dear ranchers

can anyone tell how to setup ,configure and start work in LDAP server.

please provide the tutorial.

Thanks & Regards

Srininibash