Kunal Gupta

+ Follow
since Mar 10, 2007
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 Kunal Gupta

System.out.println(5.0 == 5L);
System.out.println(5.1 == 5.1F)

the output is true and false respectively.

I want to know whether my concept here is clear or not..
In the first cast long gets promoted to double.
In the second case 5.1 is double and we shorten it to float and there fore cmparison of float and double will return false.
Am i right?
I have also posted my doubts on Covariants and other returns topic..please help me in that also.
In case of string equals() method compares the contents.
In case of arrays does it not compare the contents?

And Arrays has an equal method..Can an1 please eloborate on this topic..ITs still unclear.
The explcit cast in

A a =(A)new B();

is not required.Since sub clas with a super class reference is allowed.

Also in overiding SQLException ,ArithmeticException are both run time exceptions(unchecked).Is this the reason why they work fine in the above code?
Dear Keith,
I am still not very clear with your explaination.
DO you mean to say that an overridden method is called with the prototype of an inherited one?
These things are not explained in K&B's book..By going by the book I would definitely go with the answer to be the instance variable(a) of class B and not of class A

Oops..I am in a fix..
Hi Armen,

I would be grateful to you if you could send me the material.
My email id is : kunal.a.gupta@gmail.com

Thanks a lot.