D In some cases, is-a relationships are used in the process of autoboxing.
... you can autobox an int to a Number (via an Integer).
In some cases, is-a relationships are used in the process of autoboxing.
Deepak Bala wrote:I did not understand what you meant by method matching.
Deepak Bala wrote:Henry has provided an example in that link above. Viewed in that perspective you *could* say that is-a relationship was involved in an autoboxing
ogeh ikem wrote:This is a special case scenerio where autoboxing involves not only boxing an int to an Integer, but also involves a widening conversion to a Number.
ogeh ikem wrote:Autoboxing is a widening conversion.
Autoboxing is simply converting a primitive to an object
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
luck, db
There are no new questions, but there may be new answers.
Ogeh Ikem wrote: Autoboxing can be seen as a widening conversion
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
Autoboxing is defined as treating a primitive type as a reference type without any extra source code.
Ogeh Ikem wrote:What I'm saying is that a widening conversion can occur during autoboxing
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
In some cases, is-a relationships are used in the process of autoboxing
You can autobox an int to a Number (via an Integer)
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
in java wrappers CANNOT be widened to each other even if they have an inheritance relationship
The official term used in the Java Language Specification for an implied upcast is widening reference conversion.
Ogeh Ikem wrote:Any subclass to superclass conversion is a widening conversion.
What happens is a reference variable upcasting which the JLS identifies as widening-reference-conversion. Your point of views are respected even if they arent always compatible with mine...in java wrappers CANNOT be widened to each other even if they have an inheritance relationship
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
So do you think that the statement made in the LearnKey MasterExam Practice is wrong?
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
ogeh ikem wrote:Runtime objects cannot spontaneously change from one type to another; only their references can.
luck, db
There are no new questions, but there may be new answers.
Runtime objects cannot spontaneously change from one type to another; only their references can
is there any good link on rules of widening and autoboxing , which one takes preference over another ?
luck, db
There are no new questions, but there may be new answers.
A reference can't be 'modified'
The type of the reference doesn't change
is there any good link on rules of widening and autoboxing , which one takes preference over another ?
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.