Gagan Deep

Ranch Hand
+ Follow
since Aug 23, 2005
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 Gagan Deep

Hi All,

I found similar question in Kaithy & Bert Book's Self Test.

Chapter 6 (java.lang)
Seft Test Question Number Q 3.

Q3.
how many string objects have been created

String x = new String("xyz");
y = "abc";
x = x+y;

Choices
A. 2
B. 3
C. 4
D. 5

answer here is C. It means 4 objects have been created.
Also in explanation it is given that when we use new operator to create string object it creates 2 Objects. So i am assuming that answer to my original question is 5. Luckily today i did not get this type of quesion in my real exam . FYI TOday, i have cleared exam with 95% score.. Yuppie

Thanks
Gagan
CCNA & SCJP(95%)
In one month you got good score..
Congratulations

Thanks
Gagan.
18 years ago
Rambabu

Nice score ... COngratzzzzzz


Thanks
Gagan.
Rambabu

Nice score ... COngratzzzzzz


Thanks
Gagan.
18 years ago
congratulations Naresh...
same score as mine .... ITs party Time

Best of luck for your future endeavour

Thanks
Gagan.
18 years ago
I am very pleased to inform all of you that I have accomplished SCJP 1.4 Certification with 95%.
Here is some Knowledge transfer on how i prepared.
I read two Books

1. Kathy Sierra & Bert Bates
2. Khalid Mughal
Both are very good books. I think "Kathy Sierra & Bert Bates" is must to read for the certification & Take Khalid Mughal as a reference book there are many good concepts which are nicely presented in this book. I took many free Mock test & also paid for Wizlabs tests. Wizlab is good test series.

In the last i would like to thanks to all of you, Kathy, Bert, Khalid & wizlab creator.
I would like to help and guide any aspirants for this Certification
You guys can reach me on my mail id Deep.Gagan@yahoo.com or contact number 9886322003
Currently i am in Bangalore(india)

Once again THANKS to every one

Thanks
Gagan.
CCNA & SCJP(95%)
These days i am in Banl

Thanks
Gagan.
18 years ago
Hi Ven kaar,

I have posted whole text what i got in the mock test. Answer was 4 in the mock test. Still, I am not clear what is the exact answer. Even we cant test it how many objects will be created. Please, Let me know what else you want to know about post.

Naresh Kumar,
I got this question in Wizlabs simulator.

Abid Sami,
In K & B book(page 360, heading Creating New Strings) it is written that when we create String object using new operator, java creates two object. What about this statement? Also, we cant test it ... do any way to test it?


Kaithy Or Bert
Can you please throw some light on this ?



Thanks
Gagan
I read in K & B book(page 360, heading Creating New Strings) it is written that when we create String object usign new operator, java creates two object. Following code creates two object, one in non pool memory & one literal in pool memory

String s3 = new String("xyz");

In this way answer of the above question should be 5.

Any clarifications??
or am i understanding it wrong way??? please clarify...

Thanks
Gagan
How many String objects will be created when we will run this code.

String s1 = "abc";
String s2 = new String("xyz");
s2 = s1;
s1.toUpperCase();
String s3 = "abc";
String s4 = s3.replace('a','A');


My answer is 5 but mock exam says it is 4.
1 more simple question
Will it make any difference if we will ask
How many String objects ? or
How many objects?

Thanks
Gagan.
Thanks, Got it.

Thanks
Gagan.
Hi All,



Above code compiles & run fine but if i will remove comments then it gives compile time error. whcih is true we cannot access private variables out side a class.

But why we are able to declare static variables with private access in a class. As we all know private means we can access that variable only with in that class. But static means we can access the that variable withouht having instance of class & outside of the class.

Any pointer why java allows static & private keyword in same declaration.
Or
Any explanation

Thanks
Gagan.
velan & Abhijit,

Also please notice 'Can' in the question.

"Which two can directly cause a thread to stop executing?"

Because decreasing the thread's priority can cause thread to stop but not always. As it is implementation dependend

Thanks
Gagan.
Can we change the default disable color(grey) of checkbox in HTML...i.e the color of the small rectangle where the checkmark appears when checkbox is checked. If 'Yes', please tell how?


Thanks
Gagan.
Gauri,

Static Intializer blocks & expressions are executed only once & when class is loaded.
Also "Hi there" will be the first statement to be printed.

Thanks
Gagan.
I have confirmed, code is compiling fine(not giving any error).
Out put is
2
3
1

Thanks
Gagan.