This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Interface" Watch "Interface" New topic
Author

Interface

Suman Mummaneni
Ranch Hand

Joined: Dec 14, 2004
Posts: 87
can a class implement multiple interfaces


Suman Mummaneni
Bangalore
India
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Yes ,

[b]
A class can implements multiple interfaces .
A class can extends a single class .
A interface can extends multiple interfaces .
[b]

bye
javainthinking
Greenhorn

Joined: Dec 01, 2004
Posts: 4
Yes.
It's must follow the format below:
class implements class1,class2,...class n [extens classA](optional).

But you can't write like this below:
class extens classA,classB,classC.....

[ December 16, 2004: Message edited by: javainthinking ]

Good good study! <br />Day day up!<br />——————javainthinking
mohan gavande
Ranch Hand

Joined: Oct 07, 2004
Posts: 39
Yes,

there is multiple implenents in java
but there is no multiple inheritance in java
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
It's kind of interesting what happens if two interfaces have identical signatures, say "public void someMethod( String arg )". When you implement it once you've made both interfaces happy. But you can't tell which interface the caller had in mind when they made the call. Unless the two interfaces promise very similar behavior you run the risk of confusing the caller.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Rajith Vidanaarachchi
Greenhorn

Joined: Nov 06, 2004
Posts: 11
Hello All,
My answer is Yep.
A class can extend only one class but can implement multiple interfaces. And an interface can extend multiple interfaces.
Bye.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Interface
 
Similar Threads
How To Call Two Different Classes From the Main Program Using the Same API?
interface extends interface ?
Home interface or Home Interface stub
Time Capsule
Writing an Interface