anand-k jha

Greenhorn
+ Follow
since Dec 02, 2008
Merit badge: grant badges
For More
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
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by anand-k jha

break statement jump out of the inner loop, here if is not a loop.
So the output you are getting is correct.

Thanks,
Anand
Thanks you Punit & all,

Everything is clear now...
Still lots of confusions .......

Could any body clear it out.

- Anand
yes Ben,

Also surprised when i was see output 1st time.

- Anand
Thanks Omar,

But I am still confused ...

What we suppose to get when a map parsed to string....
Why in the 1st case map.put("A", "BBB");, nothing inserted & why "BBB" not replace with "CCC" in 2nd case.

Thanks,
Anand
Ohh....
Please replace C with A in this line as

Now the output coming as mentioned above

Thanks,
Anand

When i running this, getting
out put as - null : BBB

Could any one please explain what is happening in this code.

Thanks,
Anand
A class can cast to an interface type as marker interface.
A protected member can not access through instance of superclass, which is in another package.
Hi,

Please look below example:



Hashcode always will return a fixed value for an object, so
Second method is not appropriate here.
I think this will help you.

Anand.

In the above code we will get StackOverflowError
BUT

In this case output will be "This will never print".

Please correct me if I am wrong.

Anand
My concern is:
Why not 1st thread finish using run method & then 2nd thread start, because run is synchronized here?

Anand
Hi All,
I just started preparing SCJP & this is my first post
Got this question from:
http://www.examulator.com/phezam/question.php



No doubt the output we cannot predict here.
I am getting 10 times zebra as output.
But when I run this program with some modification, run method as synchronized:

I am getting the same output as before but I was expecting 5 times alpha & 5 times zebra.

Anand