The Artima Developer Community
Sponsored Link

Java Buzz Forum
Why Abstract class is Important in Java with Example

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 1090
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
Why Abstract class is Important in Java with Example Posted: Jun 16, 2014 7:45 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: Why Abstract class is Important in Java with Example
Feed Title: Java67
Feed URL: http://www.java67.com/feeds/posts/default?alt=rss
Feed Description: Java and technology tutorials, tips, questions for all programmers.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Java67

Advertisement
Abstract class is a special class in Java, it can not be instantiated and that's why can not be used directly. At first concept of abstraction, abstract class and interface all look useless to many developers, because you can not implement any method in interface, you can not create object of abstract class, so why do you need them. Once they face biggest constant of software development, yes that is CHANGE, they understand how abstraction at top level can help in writing flexible software. A key challenge while writing software (Java Programs, C++ programs) is not just to cater today's requirement but also to ensure that nurture requirement can be handled without any architectural or design change in your code. In short, your software must be flexible enough to support future changes. Abstract class and inheritance collectively ensures that most of the code are written using abstract and higher level classes, so that it can leverage Inheritance and Polymorphism to support future changes. This is actually one of the most useful design principle, also known as "Programming for interfaces rather than implementation".  Abstract class and abstract method are two ways through which Java assist you on coding at certain level of abstraction. We will look at syntax level details, capability and limitation of abstract class at later half of article, but you must understand why abstract class is important. More importantly, why you, a Java programmer, must understand motive and use of abstract class. From my years of experience, I can say that making a class at first an interface or abstract class is a good practice, it will not only help you to test your code quickly by supplying mock objects, but also help you to write code at certain level of abstraction. In this article, we will understand why we need abstract class and abstract method and learn how to use them by writing a simple example.
Read more »

Read: Why Abstract class is Important in Java with Example

Topic: Groovy is a language Previous Topic   Next Topic Topic: A beginner’s guide to Hibernate Types

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use