Thanks A.jyotsna,
Can u tell me differnce between abstract class and interface

vikash

Answer Posted / jyotsna gupta

Abstract Class | Interfaces
|
1. Starts with a class keyword | Starts with interface
| keyword
2. abstract modifier has to be | No need to provide abstract
provided | modifier (100 % Abstract)
3. Not necessary to contain | All methods are by default
abstract methods, but if a | public and abstract, and
class has abstract method | all attributes are public
then class has 2 be abstract| static, and final (FIELDS)

4. Used for group of related | Any class can implement
classes only | interfaces

5. Single inheritance is | Multiple inheritance can
allowed only | be achieved

6. All class behaviours are | Cannot have constructors,
allowed, except creating | should initialise its
objects of abstract classes | Fields

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the static block?

585


Can a constructor have different name than a class name in java?

592


What does pointer mean?

544


What is the return type of the main method?

575


Explain the key functions of data binding?

581






What is the final class modifier?

561


Write a java program to check if a number is prime or not?

535


explain copyonwritearraylist and when do we use copyonwritearraylist?

540


Does java allow default arguments?

592


What are the actions that can occur when a thread enters blocked state?

581


What is exception handling in java?

573


Explain the JDB in depth & command line.

567


What is the difference between compare and compareto in java?

491


Explain which of the following methods releases the lock when yield(), join(),sleep(),wait(),notify(), notifyall() methods are executed?

611


What is the collection interface?

587