ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
when,where and how to use abstract class and interface
 Question Submitted By :: Ramanareddy333
I also faced this Question!!     Rank Answer Posted By  
 
  Re: when,where and how to use abstract class and interface
Answer
# 1
If you want to provide your own services for  methods we 
use interfaces.If you want to provide your own services or 
to use the services of the methods in your class then wego 
for abstract classes.abstract class is partially implemented
and partially unimplemented class where as interface is 
completely unimplemented.both of the objects can not be 
created.
 
Is This Answer Correct ?    0 Yes 0 No
Vinaykumar
 
  Re: when,where and how to use abstract class and interface
Answer
# 2
if the developer wants some methods which are implemented 
in the super class and some methods which will be 
implementd by him then he will go for abstract class. 
because in abstact class all methods need not to be abstact 
in nature. but in interface all the methods must be 
abstract and so the developer will not get any implemented 
code from the interface. you will use interfaces when two 
different teams are working for a same requirement then an 
interface will act like a medium with which they can 
interact and all the teams will be in line.so your team and 
other team will implement the same method names but with 
difffeerent implementation code.
 
Is This Answer Correct ?    1 Yes 0 No
Prapanch
 
 
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Can a Byte object be cast to a double value?  2
What is a stream? what are the different types and classes of Streams?  2
What is left shift and right shift?  1
What is the difference between panel and frame ? IBM4
How to declare unique ArrayList ? RMSI4
could you run the java program without main method?  2
10. class Nav{ 11. public enum Direction { NORTH, SOUTH, EAST, WEST } 12. } 13. public class Sprite{ 14. // insert code here 15. } Which code, inserted at line 14, allows the Sprite class to compile? a)Direction d = NORTH; b)Nav.Direction d = NORTH; c)Direction d = Direction.NORTH; d)Nav.Direction d = Nav.Direction.NORTH;  1
What are E and PI?  1
how cani read a command line argument?(usingfile object).  3
what is main difference between architecture,framework and design pattren  1
class{ ... ... interface myinterface{ ... ... } abstract class{ .. .. } ... .. .. } is this possible to write "Interface and/ or Abstract class inside a class ? if possible whcich one is possible is only interface? is only abstract? Logica-CMG2
what is Dictionary? and what purpose it is used for?  2
what is an virtual function TCS2
what is the difference between multitasking and multithreading?  8
What do u mean by wrapper Class? What do u mean by Jvm... How do u change JVM for other OS? Or No need to Change ...? its like tricky EDS5
What happens when a main method is declared as private? Sun-Microsystems8
How can final class be used? Wipro2
Name the method of a Container that can be used to cause a container to be laid out and redisplayed?  1
What are batch updates. in jdbc Corent-Technology2
how can i cal servlet from jsp page?how can i pass variablesfrom the jsp that servlet can access? Verizon1
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com