What is an abstract method?

What is an abstract method?

Hi,

What is an abstract method?

thanks

View Answers

April 16, 2013 at 1:46 PM

Hi friend,

Abstract methods are the methods declared using the keyword 'abstract'. An abstract method must not be defined in its declaring class and it should be closed by following the semicolon at the end of line. An abstract method is defined by its implementing class or subclass. A class which declares the abstract method then this class must be declared as abstract.

An abstract method should be declared as follows :

abstract void show();
abstract void display(String name);

A class that includes the abstract method must be declared as follows :

public abstract class Show {
   // declare fields
   // declare non-abstract methods
   abstract void show();
   abstract void display(String name);
}

Ads









Related Tutorials/Questions & Answers:
abstract methods in java
variables and methods declared in abstract class is abstract or not
Advertisements
Abstract class,Abstract methods and classes
What is an abstract method?
Can a abstract class be defined without any abstract methods?
What is an Abstract Class and what is it's purpose?
What is use of a abstract variable?
What is use of a abstract variable?
What is Abstract classes in Java?
What are weak methods?
What modifiers are allowed for methods in an Interface?
what is class methods in objective c
what is class methods in objective c
What are the most common methods of Hibernate configuration?
Java Abstract Class Example
Why Abstract Class?
Why Abstract Class?
What's the proper way to test a class with private methods using JUnit?
methods
methods
methods
Abstract class
Abstract and Interface
Abstract and Interface
abstract class
Using Abstract Class
Abstract class and interface in Java
Java Abstract Class
Interface vs abstract class
abstract class
Abstract class

Ads