aspose file tools
The moose likes Beginning Java and the fly likes interface implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "interface implementation" Watch "interface implementation" New topic
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
    
    7

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
    
    1

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
    
    7

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
    
    3

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
    
    7

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
 
I agree. Here's the link: http://jrebel.com/download
 
subject: interface implementation
 
Similar Threads
equals and hashCode
Java Vectors
q on interfaces
Regarding Autoboxing and Unboxing