Learn Java Training from the Best Tutors
Search in
The classes which are defined with the abstract keyword are known as abstract classes. Abstact classes contain one or more abstract methods. An abstract method is declared but contains no implementation. It requires subclasses to provide implementations for the abstract methods. Abstraction is a feature in object-oriented programming languages like Java, where the implementation details are hidden. 'Abstract' keyword is used to create abstract classes and methods.
Abstract classes in Java are similar to the interfaces, except that it can contain default method implementation. Abstract classes only tell the programmer what to do and not how to do it.
Abstract classes are mainly required when we have to share some common operations between certain subclasses. They are primarily used for those sets of classes that are closely related to each other.
For example, if you talk about shape, then it is abstract because the shape can be anything square, round, triangle etc. But when we say triangle shape, then it is specific.
The primary purpose of using abstract classes is to enhance polymorphism feature. That means the code will work for any subclass of the abstract superclass. Abstract classes are used the same as super-classes EXCEPT that an Abstract class cannot be instanced itself, but only through classes that implement it.
read less
Related Questions
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
Why Java is the Most Popular Programming Language
Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to “write once, run anywhere” (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...
Java: An Object-Oriented Language
Java is the most commonly used popular programming language for the creation of web applications and platform today. Integrated Cloud Applications and Platform Services Oracle says, “Java developers worldwide has over 9 million and runs approximately 3 billion mobile phones”. Right from its first implication as java 1.0...
Top 5 Reasons to Learn JavaScript
Before we start on the importance of learning JavaScript, let’s start with a short introduction on the topic. JavaScript is the most popular programming language in the world, precisely it is the language - for Computers, the Web, Servers, Smart Phone, Laptops, Mobiles, Tablets and more. And if you are a beginner or planning...
Some Popular IT Courses in Current Market
In the domain of Information Technology, there is always a lot to learn and implement. However, some technologies have a relatively higher demand than the rest of the others. So here are some popular IT courses for the present and upcoming future: Cloud Computing Cloud Computing is a computing technique which is used...
Looking for Java Training Classes?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for Java Training Classes are on UrbanPro
The best Tutors for Java Training Classes are on UrbanPro