Vaishakh Menon

+ Follow
since Feb 07, 2017
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 Vaishakh Menon

Henry I think its not replacing the last Object in the ArrayList ,it is creating  a new arrayList whenever he creates an object.
Hence there is always only one Object in the Arraylist ie the last added Object.

Please correct me if I am Wrong.
4 years ago
Are you creating a new ArrayList each time  you create an Object ?
If not then why are you creating an ArrayList inside the constructor Of Course Class

I Think you should create the ArrayList outside the constructors and it will work fine...
4 years ago
Thank you

It will be really great if you can suggest me some more Books.

I have heard about the book "How  Tomcat Works". I am searching for a book of similar gene having latest information.
4 years ago
Thank you Tim.
If possible please suggest me some Books.
4 years ago
Can I read the book "How Tomcat Works by Budi Kurniawan" as this book covers  only up to Tomcat 5  ?

I am very much interested in knowing  the internal working of Tomcat .

Sorry for posting this in Java forum.

I have even posted this in Books forum but still now I haven't received any reply.
4 years ago
I am interested  to read the book "How Tomcat Works: A Guide to Developing Your Own Java Servlet Container by
Budi Kurniawan"  

I want to know about the book and the latest edition.

Please reply me your reviews.
4 years ago
ArrayIndexOutOfBoundsException occurs when you try to access an element in an array which does not exists. In your case you are trying to access the first element but the array is empty that's the reason you are getting an ArrayIndexOutOfBoundsException.

Please make sure that you are executing the code:

java filename 1

Please check this :
4 years ago
Sorry for using "should".I noticed it after I Posted it.
4 years ago
Yes you have to use equals() to compare values in the object

==  is a reference comparison, i.e. both objects point to the same memory location or not.

So please use equals().

As per my suggestion use should int instead of string because user is gone enter option number..!!!
4 years ago
Lets go step by step :

On Line 3 an object is created whose reference variable is "one" ( ie one is pointing to the Rabbit1 object).
On Line 4 an object is created whose reference variable is "two" ( ie two is pointing to the Rabbit2 object).
On Line 5 we are creating a variable and asking it to point "one"  as "one" is pointing to Rabbit1 it will also point to  Rabbit1 ( Now Rabbit1 has 2 reference variable ie "one" and "three" )
On Line 6 we are asking "one" to point null which means now our Rabbit1 has  only one reference variable ie "three" ( "one" is removed)
On Line 7 we are creating a reference variable "four" and asking it to point "one "  as "one" is pointing nothing/null "four" will also point null.

Remember our Rabbit1 still has a reference variable "three"  and Rabbit2 has "two"
On line 8 we are asking variable "three" to point null. And now after this Line we can see that even reference variable "three" is removed from the object and our Rabbit1 has no reference variable pointing it and hence it is available for gc.

On line 9 we are asking variable "two" to point to null and hence after this Line our Object becomes eligible for GC  and on Line 10 "two" is pointing to an another object which confirms that the variable "two" is not pointing to Rabbit2 anymore.

As per my knowledge Rabbit2 is eligible for GC  after  Line 9  irrespective of Line 10 written or not.....

4 years ago
If you are asking about a Buffer in Computing....

A buffer is simply a chunk of memory used to hold data.

Please read the below link:

If you want a real world example then think of the below scenario:

Imagine that you're eating candy out of a bowl. You take one piece regularly. To prevent the bowl from running out, someone might refill the bowl before it gets empty, so that when you want to take another piece, there's candy in the bowl.

The bowl acts as a buffer between you and the candy bag.

If you're watching a movie online, the web service will continually download the next 5 minutes or so into a buffer, that way your computer doesn't have to download the movie as you're watching it (which would cause hanging).
4 years ago
Your calculatePay(int hours, double payRate, double grossPay) method is a static method.
No need of creating an object to access it.

You can call the method by just  writing classname.methodname which in your case is TestClass.calculatePay(hours,payRate,grossPay).
4 years ago
Yes Campbell  the name is Test$1checker.class
If it is inside my anonymous class then why the name is not Test$1$checker.class ?

4 years ago

I have already Posted the Code Please Check it out.
My anonymous class is Closed at Line no 20 then how  my checker class  is inside my anonymous class.

Sorry for the indentation.This is my 1st post so not familiar.
4 years ago