Free Source Code and Tutorials

Custom Search



Abstraction in Java is used to hide certain details and only show the essential features of the object. In other words, it deals with the outside view of an object (interface).

An abstract class contains an abstract keyword. An abstract class can or cannot have abstract methods.

A method that is declared as abstract and does not have implementation is known as abstract method.


An abstract class with abstract method:-

  1. abstract class Fan
  2. {
  3. abstract void run();
  4. }
  6. class Havells extends Fan
  7. {
  8. void run()
  9. {
  10. System.out.println("Good speed");
  11. }
  13. public static void main(String args[])
  14. {
  15. Fan obj = new Havells();
  17. }
  18. }


Good speed

Facebook Comments
(Visited 5 times, 1 visits today)
Share this

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked * © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!

%d bloggers like this: