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   To Refer this Site to Your Friends   Click Here
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 ?    11 Yes 2 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 ?    17 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 ?    6 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 ?    4 Yes 4 No
Ashok Kumar
 
  Re: If all the methods in abstract class are declared as abstract then what is difference between abstract class and in interface?
Answer
# 5
You can inherit the abstract class and use only those 
methids which you want.

But in Interface you have you implement every method.
 
Is This Answer Correct ?    2 Yes 8 No
Prasad Bhagwat
 
  Re: If all the methods in abstract class are declared as abstract then what is difference between abstract class and in interface?
Answer
# 6
i am not agree with the answer provided by prasad bhagwat 
as already mention inthe question that all the method of 
abtract class are declared as abstract and as per rules of 
abstract class impletation you need to provide 
implemenation of all abstract methods present in abstract 
class unitl & unlesss you declared child class also as an 
abstract class.
 
Is This Answer Correct ?    3 Yes 0 No
Sumit Jain
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
how to handled exceptions & erros in ejb? Satyam1
how to compile jsp? Logica-CMG3
Why to give the file name same as the public class name in java?  3
what is diff bet iterator and enumeration?  2
what's diff between struts 1.1 & 1.2 Wipro2
Difference between local and global transaction ? iFlex1
Howmany address lines are required to addressing 1 MB memory?  2
What are the advantages of the model over the event- inheritance model?  1
Difference between String and String Buffer?  3
What is the purpose of the File class?  2
who can we create the object of a class? in how many ways we can create it (max 5)  1
What is the difference between jsp and servlet? Symphony5
Can we declare an anonymous class as both extending a class and implementing an interface? Wipro7
Explain break statement and continue statement?  3
what is the difference between the "protected and default" modifiers?  4
wahts is mean by thread? HCL14
How to declare unique ArrayList ? RMSI4
What is exception and error? and what is the difference between them?  2
What is operator?  2
Is 'sizeof' a keyword?  5
 
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