Loveen Jain

Ranch Hand
+ Follow
since Jan 24, 2004
Merit badge: grant badges
For More
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 Loveen Jain

??? How do you call this Implementation class as an inner class?
Hi Bu,

According to my understanding. array will not be garbage collected because no matter you setted it to null when it was in the method f. when you come out of it it still holds three nulls, and an object array[3], which is still initialized.

Please tell me if I am right Bu? Because if i am right, then I have a clue for Fred that its something related to how an array is passed in the method as parameter, just think over it.

And I apologize in advance to Fred, if I am wrong.

So Bu please tell am i right or wrong?

This explanation was given in the Java API documentation for StringBuilder
I agree to Vyas. Please explain this explanation given at

The characters of the CharSequence argument are inserted, in order, into this sequence at the indicated offset, moving up any characters originally above that position and increasing the length of this sequence by the length of the argument s.

it says moving up any characters originally above that position

Output should be "Hello"

Because in the Constructor there is no way that the compiler can distinguish that we are talking about the class member.

So it would assign "Hello World" = "Hello World" i.e. String = String.

And as String is initialized to be "Hello" in its declaration itself.
toString() method will use it as it is and will display "Hello" as the output.

Preparing for SCJP1.5
Hi, seeing your experience I think you should start up from SCJP. As it is mandatory for SCWCD, SCBCD, SCJD.
I would say go for 1.5.
1.6 is very fresh and new, and I doubt if there is any exam released for it yet.


I think you are talking about this code right?

Answer is certainly 4 2.

Reason :
a) First print statement : 14 % 5 = 4 ( is the remainder after divison of 14 by 5)
b) Second print statement : 7 % 5 = 2 ( is the remainder after divison of 7 by 5).

I hope its clear!
Are you sure you turned on the assertions while running the program.

Try this:
java -ea <class-name>

I tried to run this code and got the following Exception

Exception in thread "main" java.lang.AssertionError: Out of range
at com.javaranch.AssertTest.testValue(
at com.javaranch.AssertTest.main(
Congratulations!!! I have also registered for the exam will be taking it in mid of Dec. Please give me some advice on preparation.
17 years ago

I am planning to start up an application purely in Java. I am still thinking that what would be the best approach to build the front end (I mean in terms of Technology to be used) and the IDE for that support.

I would request if anybody can guide me with what all best options are available in Java space so that i can perform a comparative study to decide on what approach shall I take.

Thanks in advance !
17 years ago
Thanks Ernest, I have updated my name.

Well thanks Benoit, I thought that nobody would reply that message.

I am using manual jdb because I have only commandline Linux installed. And I am developing in VIM and there is no way out to debug the code rather then using jdb.

So in case there is any other tool that I can use, I will be delighted to know that.

Thankyou in advance!!
17 years ago
Hi all,

I am debugging a java source using jdb.(back to old days). Well while going through it in order to see the source I do .
But, unfortunately it only shows me a set of 10 lines.
Can anybody please guide me is it possible to increase the number of lines to be shown by list command? And if yes then please guide me how to do it.

17 years ago
Dane! is really great. In case he has originally thought about this concept and story then, this is very good.

Clearly shows he is damn! creative and a good narrator.
18 years ago
try including these two lines in your code.....
<% page import="javax.servlet.*" %>
<% page import="javax.servlet.http.*" %>
19 years ago