UrbanPro

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is the need of abstract class?

Asked by Last Modified  

Follow 2
Answer

Please enter your answer

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...
read more

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
Comments

Related Questions

What is the advantage of Java?
Java is object-oriented. This allows you to create modular programs and reusable code. Java is platform-independent. One of the most significant advantages of Java is its ability to move easily from one computer system to another
Kripal
0 0
5
What is an Exception in Java?
Exception is the type of class which we are using in java to check and validate our code. if there is any problem in our code then compiler will throw exception. there are two types of exception. one is...
Piyush
0 0
5
Which is a good Java training and placement institute for a fresher in Bangalore?
I know an institute in HYderabad which is giving 100% job guarantee or 100% fee refund. They have office in bangalore also, not sure whether they are offering this program in Bangalore. Please visit their...
Raja
0 0
5
Between Java and Python, which one is better to learn first and why?
Both the development programs come with their strong suits. While Java allows you to enjoy the cross-platform support, Python helps you execute on at least ten different operating systems. It would help...
Priyanka
0 0
5

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Java : Compile-time Versus Runtime optimization
While designing and development, one should think in terms of compile-time and run-time.It helps in understanding language basics in a better way.Let's understand this with a question below : What...
S

SWITCH STATEMENT IN JAVA
switch statement - condition statement - only once the checking takes place so we recommend use break statement. switch(condition/variable/choice){case 1: //statements break;case 2: // statements break;case...

Create Immutable Class
Snippet of an Immutable Class: package com.stringhr; /*Declare the class as 'final'. This would prevent any other class from extending it and hence from overriding any method from it which could modify...

Java Overview
Java platform overview Java platform components The Java platform consists of the following components. The Java language Like any programming language, the Java language has its own structure, syntax...
A

Akshay Shende

0 0
0

ListIterator Example
public class ListIteratorEx { public static void main(String args) { List<String> li = new ArrayList<String>(); li.add("java1"); li.add("java2"); li.add("java3"); li.add("java4"); ListIterator...
S

Sarthak C.

0 0
0

Recommended Articles

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...

Read full article >

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...

Read full article >

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...

Read full article >

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...

Read full article >

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 you
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more