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
If all the methods in abstract class are declared as 
abstract then what is difference between abstract class and 
in interface?
 Question Submitted By :: Namita
I also faced this Question!!     Rank Answer Posted By  
 
  Re: If all the methods in abstract class are declared as abstract then what is difference between abstract class and in interface?
Answer
# 1
In abstract class concrete methods are also there. concrete 
methods are the one which has implementation. so in future 
if any programmer wants to give concrete methods can use 
abstract class not interface. 
In abstract class for methods and variables 
public,private,protected modifier can be use. but in 
interface public and abstract are permitted.
 
Is This Answer Correct ?    3 Yes 0 No
Namita
 
  Re: If all the methods in abstract class are declared as abstract then what is difference between abstract class and in interface?
Answer
# 2
if all the methods are abstract in abstract class,then the 
only difference left is,,,,

interface can have static and final variables with public 
and abstract access modifier only ,,,while abstract class 
can have any type of variable with any type of access 
modifiers
 
Is This Answer Correct ?    7 Yes 0 No
Ravi
 
 
 
  Re: If all the methods in abstract class are declared as abstract then what is difference between abstract class and in interface?
Answer
# 3
Multiple inheritance is possible only through interface,not 
with abstract class. So if u have an interface we can go 
implementing multiple interfaces rather than extending a 
single abstract class.
 
Is This Answer Correct ?    1 Yes 0 No
Ravi Sv
 
  Re: If all the methods in abstract class are declared as abstract then what is difference between abstract class and in interface?
Answer
# 4
Methods in the abstract class can be accessed only through 
a class hierarchy i.e through inheritance.

But methods in the interface can be accessed anywhere i.e 
across the class hierarchy.(without inheritance).
 
Is This Answer Correct ?    1 Yes 0 No
Ashok Kumar
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What is static variable and static method? TCS4
What classes of exceptions, thrown by a throw statement?  2
what is the use of custom tags? with example? Photon1
What is the difference between static and non-static variables?  2
different types of threads? TCS5
What is the minimum and maximum length of an identifier? TCS6
In what ways you can handle exception ?  2
What Method and class used for Connection pooling ? Wipro2
is memory to the abstract class allocated ..or objects not instantiated TCS4
What restrictions are placed on method overloading and method overriding?  2
what is an object and how do you allocate memory to it? Wipro3
what is the difference between AWT and SWING what is the advantage of using swing?  2
Can you declare a static variable in a method?  3
What is meant by final class, methods and variables?  2
Explain Global variables in Packages?  1
Explain break statement and continue statement?  3
what is life cycle of applet?  3
Are there any tools available in java to create reports?  4
What is difference between hash mapping and hash table? NDS3
What is an enumeration class?  2
 
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