Difference between abstract class and Interfaces in Java
Answers were Sorted based on User's Feedback
Answer / surendrareddy
abstract clas have both abstract methods and Concrete methods.
but interface have only abstract methods,
And also abstract class have construtor,but interface
doesn't have.
Is This Answer Correct ? | 48 Yes | 9 No |
Answer / guest
abstract classes can have other concrete methods but
inteface only abstract methods.
Is This Answer Correct ? | 35 Yes | 4 No |
Answer / manish sharma
Abstract classes Interfaces
Abstract classes are used only when there is a “is-a” type
of relationship between the classes. Interfaces can be
implemented by classes that are not related to one another.
You cannot extend more than one abstract class. You can
implement more than one interface.
Abstract class can implemented some methods also.
Interfaces can not implement methods.
With abstract classes, you are grabbing away each class’s
individuality. With Interfaces, you are merely extending
each class’s functionality.
Is This Answer Correct ? | 24 Yes | 4 No |
Answer / your friend
abstract classes can have any type of medthods but
interface allows only abtract methods.
Interface is like a class not a class .
Is This Answer Correct ? | 19 Yes | 8 No |
Answer / venkateswarlu dhaninkula
Interfaces consists of pure abstract methods
but not abstract class
abstract class having both abstract methods and non
abstract methods
interfaces declare all variables are final and public
but not abstract class
abstract class has a default constructor
but not interface
Is This Answer Correct ? | 8 Yes | 1 No |
Answer / megha mokawat
Abstract class can have non-final variable aslo
but in interface variable are final by- default
Is This Answer Correct ? | 8 Yes | 2 No |
Answer / narasimha raju
An abstract classes can have concrete methods and declares
abstract method which method can implement in different
ways. whereas in interface all are abstract methods.
in abstract class we can declare any type of variable
but in interface all are final variables.
Is This Answer Correct ? | 8 Yes | 5 No |
Answer / krishna
In Abstract class should implementation methods information
with complete i.e Programmer duty .
But in Interfaces we can give implementations to End-User .
Is This Answer Correct ? | 0 Yes | 0 No |
how many types of operating system are avaliable?
what is difference between restoring and non restoring division?
class A{ void me(){s.o.p("");} class B extends A{ void me() {s.o.p(" ");} class M{ A a=new B(); B b=new A(); a.me(); b.mne();} what is the output of this, how?
2 Answers Cosmos, HyTech Pro, WinSoft,
When we delete logfiles such as screenshots how does it affect the ldf file? Ive seen huge change while adding screenshots in the ldf file but a very minor one deleting them.Please Explain
Create a class TicTacToe that will enable you to write a complete program to play the game of Tic-Tac-Toe. The class contains as private data a 3- by-3 double array of integers. The constructor should initialize the empty board to all zeros. Allow two human players. Wherever the first player moves, place a 1 in the specified square; place a 2 wherever the second player moves. Each move must be to an empty square. After each move determine whether the game has been won and whether the game is a draw. If you feel ambitious, modify your program so that the computer makes the moves for one of the players automatically. Also, allow the player to specify whether he or she wants to go first or second. If you feel exceptionally ambitious, develop a program that will play three-dimensional Tic-Tac-Toe on a 4-by-4-by-4
Given: (x-2)(x+3)= 100; solve the equation for x using any programing language.
Write a program to implement BFS/ DFS routine in a connected graph
.net 2005 supports how many languages?
what you mean by mantis in IT interview? why we use mantis? advantage of mantis?
I want to pass .pdf files as OlE Object to crystal report through VB6. Please any one guid me...
why rownum=1 works properly but not rownum=>2,=>3 etc.
HOW TO BREAK THE FIREWALL?