GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 102 of 502    Print  
I need some more information about interface. For Example there is no any functionality inside the method which is declared in any interface. Then why i want to implement that interface to my class.

2. Statement is an interface. When i say stmt.executeQuery(). I am getting the records in my ResultSet. How it is possible?.. since there is no functionality insid the methods which is declared in Statement Interface. What is happning here?
An idea


  
Total Answers and Comments: 6 Last Update: June 03, 2008     Asked by: antony_praveen80 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: sarat
 

hi

that iner face have the reference which is getting from its implementing class

ex:

interface a;

class b implements a;

then a a1=new b();

a1.method();

like above interfaces also used for methods even though they dont have body

the above mean thare is the methods declared by a is implemented in b class



Above answer was rated as good by the following members:
antonysuresh
September 29, 2005 05:53:16   #1  
Padmaja        

RE: I need some more information about interface. For ...

The JDBC driver vendor provides the implementation of the API. Please go thru the purpose of JDBC Drivers.


 
Is this answer useful? Yes | No
September 29, 2005 06:39:47   #2  
sarat        

RE: I need some more information about interface. For ...

hi

that iner face have the reference which is getting from its implementing class

ex:

interface a;

class b implements a;

then a a1 new b();

a1.method();

like above interfaces also used for methods even though they dont have body

the above mean thare is the methods declared by a is implemented in b class


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
October 03, 2005 04:44:29   #3  
sangeeta        

RE: I need some more information about interface. For ...
The interface is implemented privately in rt.jar which you put in ur lib directory and set it in your classpath.
 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
November 16, 2005 12:17:57   #4  
mohana        

RE: I need some more information about interface. For ...
hi this is mohana interface is alternate for multipleinheritence java does not support multiple inheritence so interface is replace that one and also apply polymorphism by using interface.thanq bye cheers.... anotherone is i d't know sorry
 
Is this answer useful? Yes | No
July 20, 2006 08:00:24   #5  
sasi        

RE: I need some more information about interface. For ...

hi.....

for example..take SUN as example..they provides..only interfaces..that means..they give only NULL implementations..

i.e.what is the returntype of the interface..

what is the method & its arguments

like that.....so according to that we provide a boby to the interface later..with better accuracy..following some..standrds.

so it is better for third party vendory..who provides a body in better way......thats the reason interfaces are having much important im java


 
Is this answer useful? Yes | No
June 03, 2008 10:56:52   #6  
vinaymudgil007 Member Since: May 2008   Contribution: 43    

RE: I need some more information about interface. For Example there is no any functionality inside the method which is declared in any interface. Then why i want to implement that interface to my class. 2. Statement is an interface. When i say stmt.execut
well the answer given by sarat is a very good one & explains the concept.....
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape