This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!

aparna kodali

Greenhorn
+ Follow
since Oct 17, 2005
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 aparna kodali

Hi !
I agree with Mick.
b is wrong.
calling System.gc() only "suggests" that the JVM expends effort toward recycling unused objects. Some other thread might prevent the garbage collector from running. (from RHE)
kodali
Hi ragavan!
This is the site
http://suned.sun.com/USA/certification/progsq.html

be cool and All the Best

kodali
Hi Krishna,
The StringBuffer and the String class do not have any hierarchical relationship. So the JVM cannot resolve at compile time as to what type of class does null refer to. Hence the compile time error.
null can be an object reference to the Object class or the String class. But java.lang.String extends from java.lang,Object,
so the JVM assumes that the null is used as a reference for a String Object. Hence the overloaded method with String argument is called.
hope this helps
kodali
hi!
Inner class, unless 'static',have access to the variables of the enclosing class instance. ADDITIONALLY, inner classes defined in method scope have access to 'final' variables of the enclosing method.
Hope u got the point.
kodali
Hi !
I have copied your exact code and when I compiled and run this ,I did not get any errors.Casting a subclass to a super class is perfectly legal at compile time and runtime.
kodali
Hi Jairat!
You are passing a copy of the reference variable 'ex' to the method.And you are assigning a new reference value 'h' to 'ex'.
When an argument is passed into a method,changes to the argument value by the method do not affect the original data.
But when the called method operates on the object via the reference value that is passed to it, the changes will be visible to the caller.
Hope this clarifies your doubt.
kodali.