| Author |
interface implementation
|
neha. bajaj
Ranch Hand
Joined: Jul 15, 2012
Posts: 31
|
|
|
|
 |
neha. bajaj
Ranch Hand
Joined: Jul 15, 2012
Posts: 31
|
|
Oops.. hadn't implement interface
|
 |
Winston Gutkowski
Bartender
Joined: Mar 17, 2011
Posts: 4734
|
|
neha. bajaj wrote:Oops.. hadn't implement interface
So, that's settled is it? I didn't see a question.
Winston
|
Isn't it funny how there's always time and money enough to do it WRONG?
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3786
|
|
|
I think the implied question was "why is this implementation allowed when the return type is wider?".
|
 |
neha. bajaj
Ranch Hand
Joined: Jul 15, 2012
Posts: 31
|
|
Matthew Brown wrote:I think the implied question was "why is this implementation allowed when the return type is wider?".
I don't think widening is working here.I tried but byte is not subtype of int but Byte is subtype of Number.
|
 |
Winston Gutkowski
Bartender
Joined: Mar 17, 2011
Posts: 4734
|
|
neha. bajaj wrote:I don't think widening is working here.I tried but byte is not subtype of int but Byte is subtype of Number.
How is converting an int to a byte widening?
My suggestion: explain what you want to do, and ask a question; and we might be able to help.
Winston
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12907
|
|
|
byte is not a subtype of int, and long is not a supertype of int - there's no inheritance relationship between the primitive types.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Sirajuddin Khan
Greenhorn
Joined: Jul 07, 2012
Posts: 1
|
|
neha. bajaj wrote:
for your kind information, please check your code because it is not implement the interface's method so you got compile-time error.
You are doing overloading....
|
 |
Winston Gutkowski
Bartender
Joined: Mar 17, 2011
Posts: 4734
|
|
Sirajuddin Khan wrote:please check your code...
Sirajuddin,
Please don't post very long lines in code. I broke yours up this time and I suggest you re-read the UseCodeTags page thoroughly.
This applies whether you are posting your own code or somebody else's.
Thanks.
Winston
|
 |
 |
|
|
subject: interface implementation
|
|
|