What is an abstract class and abstract method?

Answer Posted / tarun

Abstract Class : An abstract class can not be initialized.
Any class can extends it. The methods declared in the
abstract class can be abstract or not.
Abstract Method : If any method is declared as abstract
method it should be in a abstract class. And it can be
override by any other class which is extending it. if method
is declared as abstract it should not contain body.

For Example:
public abstract class AbstractEx {
public void reset(){
System.out.println("The Sun Rises in the east");
}
public abstract void method();
protected abstract void newmethod();
}

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a method be static?

530


What is variable in java?

535


Say any two properties in beans?

638


What is the difference between a static and a non-static inner class in java programming?

539


What are operators and its types?

583






What are java annotations?

655


how to write a server program and sending the mails to the server using smtp protocol please help me

1555


What are functions in java?

508


Variable of the boolean type is automatically initialized as?

605


What is difference between equal and == in java?

530


What types of index data structures can you have in java?

624


can rmi and corba based applications interact ?

683


What is the full meaning of java?

545


What is an iterator interface in java programming?

543


What is final method?

596