Share this post on:

Abstract Keyword in Java is used by force inheritance mechanism. Abstract keyword can be used with class as well as with method.

Abstract Method: Abstract Method does not have implementation that is Abstract method has only its name. Its Implementation must be implemented by its subclass. Abstract method must be declare or return in Abstract Class.

Syntax of Abstract Method:

modifier abstract return type method name(argument if any);

Abstract Class: Abstract Class is just associated with Abstract keyword.

Syntax of Abstract Class:

abstract class classname

{

}

Properties of Abstract Class:

  1. Abstract Class cannot be instantiated that is we can not create its object.
  2. Abstract Class Support 0 to 100% Abstraction.
  3. Abstract Class can have Constructor, static method, static block, Abstract methods, non-Abstract method that is all things which are in simple class.
  4. If a class extends the abstract class then that class must be implement the abstract method of abstract class otherwise it give error. If subclass does not want to implement the abstract method of a Abstract class then that class should be declare as abstract.
Share this post on:
Avatar Raiyan

Author: Raiyan

Hi, I guess you're here because you want to know a bit about me. huh? I am not so good on talking about myself but I'll give a short about me.

My Name is Raiyan. I am a Professional Application Developer and a Blogger.
I started this website to Share my Knowledge. Here I provide all my knowledge whatever I earned till now.

2 Comments

  1. Pingback: How To Use Interface In Java Programming - ArzaTechs

  2. Pingback: What are Important topics in java for Interview? - ArzaTechs

Leave a Comment

Your email address will not be published. Required fields are marked *