arpit dhingra

Greenhorn
+ Follow
since May 25, 2011
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 arpit dhingra

hi,, i am very much confused about how finalize() method works since there is very less explanation about this method.
can anyone help me out in explaining that in the following the defined object is eligible for garbage collection, If it is, how? and if not why? or will it ever be able to get collected by garbage collector as there exists a live ref reffering to the object.. please help in explaining the story behind the scenes..


thanks.
regards.
thanks a lot for the link..


hi.. It is being said that static methods cant be overriden as static methods are methods of the class and doesnot belong to any object.
but at line 15 and line 24 static method defined in superclass is strictly obeying rules of overriding.

at line 15 its not letting declare any checked exception which is not defined in superclass method
at line 24 its not letting change only the return type as void is the subtype.


if static methods are methods of classes why am i not able to declare a method with same name but diffrenent return type or checked exception, why is the method behaving as if it were overriden.

thanks.
regards.
i am preparing for scjp 1.6 and while trying out some code experiments on primitive typcasting i found some unusual behaviour on floating point numbers.
can anyone help me explain whats happening here..


byte ca = (byte)128; // needs an explicit cast because 128 is 32 bit int.
ca = (byte) ca + 12; //explicit cast because evaluting exp is implicitly converted to 32 bit int.

the above code is understandable.



but in the following code

float m = (float) 23.6; // explicit cast because floating points are 64 bit doubles by default and works fine.

...........................................................................................................................................................................................................................

m = (float) m + 5.7; // error . .. why???


why does this line of code doesnt complile. i have given an explicit cast for converting the evaluated double to float. then too it shows an error.
may i know the reason for this behavoiur.

thanks.
regards.