Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Interface

This is a discussion on Interface within the OOPS forums, part of the Software Development category; If we have one interface with 5 methods, then is it compulsory to implement all the 5 methods in the implement class? If not will it give any error? - ...

Go Back   Geeks Talk > Software Development > OOPS
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

OOPS Object-Oriented Programming Concepts

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-01-2008
Junior Member
 
Join Date: Dec 2008
Location: Chennai
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
mahasang2k is on a distinguished road
Interface

If we have one interface with 5 methods, then is it compulsory to implement all the 5 methods in the implement class? If not will it give any error?

- can i implement 2 methods in one class and another 3 methods in different class?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-02-2008
Expert Member
 
Join Date: Nov 2008
Location: Chennai
Posts: 303
Thanks: 1
Thanked 37 Times in 32 Posts
amitpatel66 is on a distinguished road
Re: Interface

Yes it is mandatory to implement all the 5 methods in a class that calls an interface. When you say IMPLEMENTS <interface_name> in java, then all the methods in that interface needs to be implemented
Reply With Quote
The Following User Says Thank You to amitpatel66 For This Useful Post:
  #3 (permalink)  
Old 03-20-2009
Junior Member
 
Join Date: Mar 2009
Location: hyderabad
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
spicysunny is on a distinguished road
Re: Interface

Quote:
Originally Posted by mahasang2k View Post
If we have one interface with 5 methods, then is it compulsory to implement all the 5 methods in the implement class? If not will it give any error?

- can i implement 2 methods in one class and another 3 methods in different class?
no it is not possible if u r using interface u have to implement all the methods in the inherited class
Reply With Quote
  #4 (permalink)  
Old 03-20-2009
Junior Member
 
Join Date: Mar 2009
Location: hyderabad
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
spicysunny is on a distinguished road
Re: Interface

no it is not possible if u r using interface u have to implement all the methods in the inherited class
Reply With Quote
  #5 (permalink)  
Old 08-08-2009
Junior Member
 
Join Date: Aug 2009
Location: india
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
murali_yerukola is on a distinguished road
Re: Interface

no it is nt possible
Reply With Quote
  #6 (permalink)  
Old 08-27-2009
Junior Member
 
Join Date: Apr 2009
Location: Pune
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
shashankkale is on a distinguished road
Re: Interface

no you cant do that....
if you want to do so...then you have to implement two different interface
Reply With Quote
Reply

  Geeks Talk > Software Development > OOPS

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
API/Interface for implementing MRC ssriramkumar Oracle Apps 0 05-28-2007 05:30 AM
API/Interface for implementing MRC ssriramkumar Oracle 0 05-28-2007 05:29 AM
API/Interface for implementing MRC ssriramkumar SQL 0 05-28-2007 03:41 AM
COM interface JobHelper QTP 1 03-30-2007 02:07 PM
interface..... psuresh1982 Java 1 01-08-2007 01:40 PM


All times are GMT -4. The time now is 03:32 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved