Sundar Murthi

Greenhorn
+ Follow
since Dec 03, 2003
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 Sundar Murthi

Hi

The following qn found in one of the mock exam
what is the output


what is the output?

My view is
its a compiler error
but the ans is "it prints 20"

how it is?

actualy
static{
}
is not a method its a block of code
how the variable i declared with in i is ignored..

tx in adv..
How many threads are started in the code at label is reached



i know that while calling run() method no thread was created.
it is just a method calling

but the ans given is

one thread is started how it is
Hi Corey
I understand the purpose of intern() method and get the result as true.
It creat a new string if it is not exists in a string pool. If exists its refference is returned.

Still i have the problem

look at the following one


it returns true

and
[CODE]
String str="Hello";
(str.replace('e','e')=="Hello")
[CODE]

it returns false

How it is??
Hi Shilpi
Kai's notes it self given a good explanation for that one

and many more discussions and sample codes in kai notes(last edited by 2000) contains bugs
dont wory about it