Overloading and type conversion
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I have a method CALL which passes a character as an argument, and the class defines two methods of same name one with argument of type character and another of type int. Which method will be called at runtime, the one with int or the one with character??
Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ya Akhil,
in such cases "The Most Specific Method Is Chosen"
Read JLS2.0 for more details.Hope it helps u!
in such cases "The Most Specific Method Is Chosen"
Read JLS2.0 for more details.Hope it helps u!
Akhilesh Trivedi
Ranch Hand
Posts: 1609
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
thanks vijay and ashok
Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
hi hope this will help
the result is "int"
[ November 23, 2005: Message edited by: Ost. Ken ]
the result is "int"
[ November 23, 2005: Message edited by: Ost. Ken ]
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I thought your example was a hoot, Ost. Ken,
but I fear that many here will not see your
slight-of-hand and misunderstand things.
We all agree that if you write the second
test() method to take a parameter of type
char instead of Character that the result
will not be "int", right?
[ November 23, 2005: Message edited by: Brian Cole ]
but I fear that many here will not see your
slight-of-hand and misunderstand things.
We all agree that if you write the second
test() method to take a parameter of type
char instead of Character that the result
will not be "int", right?
[ November 23, 2005: Message edited by: Brian Cole ]
Ost. Ken
Greenhorn
Posts: 4
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi,
if Character change to char result will not be "int".
sry about my bad sample
....
i think the correct answers was already replied by vijay and ashok
My purpose is to show Autoboxing/Unboxing will not use in this case(but i didn't tell that my sample is for 5.0 ...very very sry about that).
thank you for ur comment Brian ^^
if Character change to char result will not be "int".
sry about my bad sample
....i think the correct answers was already replied by vijay and ashok
My purpose is to show Autoboxing/Unboxing will not use in this case(but i didn't tell that my sample is for 5.0 ...very very sry about that).
thank you for ur comment Brian ^^
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi,
what "The Most Specific Method Is Chosen" in the sense.
any body please explain little bit more
what "The Most Specific Method Is Chosen" in the sense.
any body please explain little bit more
Sasikanth
| Get meta with me! What pursues us is our own obsessions! But not this tiny ad: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |









