You are on page 1of 5

1

Abstract Classes and Methods


JAVA FUNDAMENTALS

Abstract Classes

Abstract Class

abstract key word.

Compiler wont let you instantiate the


abstract class

You must extend an abstract class to


create Concrete behaviour

Abstract Vs Concrete

Abstract Methods

public abstract void eat();

If you declare an abstract method, you MUST declare


the class as abstract. You cannot have an abstract
method in a non-abstract class.

You must implement all abstract methods.

DEMO TIME

You might also like