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 |
Write a program to reverse a number?
What is the use of Differ interface check box in Ship confirm?
One boy has to climb steps. He can climb 1 or 2 steps at a time. Write a function that will returns number of way a boy can climb the steps. Int WaytoSteps(int n) (eg:- suppose number of steps is n=4 ,the function will return 5 (one-one-one-one ,one-one-two, one-two-one-,two-one-one, two-two)
what is the current salary package in India for a lamp programmer
merge sort time complexity
6 Answers BFL, CDAC, IBM, Jawaharlal Nehru Technological University JNTU,
Write a shell program. Enter number of days from keyboard. Find out the number of years, month and days it contains
WAP to print all prime nos between 1 to 100 without using user input...pls reply within few hours...
how sap is different from other software ?
WS-NUM PIC S9(05)V(02) SIGN TRAILING SEPARATE MOVE '0050000+' TO WS-NUM The value stored is 00500,00+ MOVE '0050000-' TO WS-NUM Then what is the value will be stored in WS-NUM? Am getting '-00500,00'.....>>> What should I declare to WS-NUM so that I can get correct values for both + & - signs.
Who is providing best mainframes online training in Hyderabad
What is the difference between compiled and interpreted languages?
I'm new to ABAP. What is Module pool in SAP?