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);
}









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 class?
what is the meaning of abstract?
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?
Abstract methods and classes
what's the purpose of constructor in abstract class?
What are weak methods?
The ActionForm and what are important methods in ActionForm.
What modifiers are allowed for methods in an Interface?
What are the difference between abstract class and interface?
what is class methods in objective c
what is class methods in objective c
What are the methods in Object? - Java Beginners
What are the most common methods of Hibernate configuration?
Java Abstract Class Example
Abstract class or methods example-1
abstract method
abstract class
The abstract Keyword : Java Glossary
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 class and abstract method
abstract class
Abstract and Interface
Using Abstract Class
abstract class - Java Beginners
Abstract class and interface in Java
Java Abstract Class
Interface and Abstract class
Interface vs abstract class
abstract class
abstract class and interface - Java Beginners
Abstract class or methods example-2
abstract class and overriding - Java Beginners
Abstract class or methods example-3
Abstract class
abstract method

Ads