Yes, create a new class using Right Click (on the package where you want to create the class) > New > Class, and in the SuperClass field, you can select your abstract class. Be sure that the checkbox Which method stubs would you like to > Inherited abstract methods is checked.

If you have already created your class, you can make it extend you abstract class by hand, and use Right Click (on the source code) > Source > Override/Implement Methods... and choose which methods you want to implement (if they are not already implemented).

An other way to do it, is to extend your abstract class by hand, and use the Quick Fix provided by Eclipse to Add unimplemented methods. You can call the Quick Fix tooltip by highlighting the error and using Ctrl+1, or by clicking on the error icon on the left of the code.

Answer from Florent Bayle on Stack Overflow
🌐
Oracle
docs.oracle.com › javase › tutorial › java › IandI › abstract.html
Abstract Methods and Classes (The Java™ Tutorials > Learning the Java Language > Interfaces and Inheritance)
You cannot instantiate them, and they may contain a mix of methods declared with or without an implementation. However, with abstract classes, you can declare fields that are not static and final, and define public, protected, and private concrete methods. With interfaces, all fields are automatically public, static, and final, and all methods that you declare or define (as default methods) are public.
🌐
W3Schools
w3schools.com › java › java_abstract.asp
Java Abstraction
assert abstract boolean break byte case catch char class continue default do double else enum exports extends final finally float for if implements import instanceof int interface long module native new package private protected public return requires short static super switch synchronized this throw throws transient try var void volatile while Java String Methods
🌐
GeeksforGeeks
geeksforgeeks.org › java › abstract-classes-in-java
Abstract Class in Java - GeeksforGeeks
If the Child class is unable to provide implementation to all abstract methods of the Parent class then we should declare that Child class as abstract so that the next level Child class should provide implementation to the remaining abstract method. ... // Java Program to demonstrate // Observation import java.io.*; abstract class Demo { abstract void m1(); abstract void m2(); abstract void m3(); } abstract class FirstChild extends Demo { public void m1() { System.out.println("Inside m1"); } } class SecondChild extends FirstChild { public void m2() { System.out.println("Inside m2"); } public v
Published   July 23, 2025
🌐
Programiz
programiz.com › java-programming › abstract-classes-methods
Java Abstract Class and Method (With Example)
Become a certified Java programmer. Try Programiz PRO! ... The abstract class in Java cannot be instantiated (we cannot create objects of abstract classes). We use the abstract keyword to declare an abstract class.
🌐
Javatpoint
javatpoint.com › abstract-class-in-java
Abstract class in Java - Javatpoint
Abstract class in Java - Abstract class in java with abstract methods and examples. An abstract class can have abstract and non-abstract (concrete) methods and can't be instantiated with inheritance, polymorphism, abstraction, encapsulation, exception handling, multithreading, IO Streams, Networking, String, Regex, Collection, JDBC etc.
🌐
DigitalOcean
digitalocean.com › community › tutorials › abstract-class-in-java
Abstract Class in Java | DigitalOcean
August 3, 2022 - Abstract class in Java is similar to interface except that it can contain default method implementation. An abstract class can have an abstract method without body and it can have methods with implementation also. abstract keyword is used to create a abstract class and method.
🌐
Simplilearn
simplilearn.com › home › resources › software development › java tutorial for beginners › what is an abstract class in java and how to implement it?
What is an Abstract Class in Java and How to Implement It?
January 26, 2025 - This article explains what is abstract class in java, features of abstract class, the syntax and examples of abstract class, and the interface vs abstract class. So, read on to learn more!
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
Find elsewhere
Top answer
1 of 4
26

Quick methods:

  • Hold Ctrl, hover over the method name, and select "Open Implementation".

  • Click on the method name and press CtrlT.

  • Right-click on the method name → "Quick Type Hierarchy".

For more navigation power, see the post by ADTC.

2 of 4
16

Great answers here! I found an additional trick to quickly navigate from implementation to implementation.

It is rather strange that Eclipse uses a temporary pop-up to show "Types implementing or defining 'Class.method()'" instead of a permanent view that can be pinned to the sides.

The advantage of this pop-up is, when you click on an implementing type, you are taken directly to the method implementation. The disadvantage of this pop-up is that it closes as soon as you do so, and there is no way to pin it permanently.

The Type Hierarchy shows the same list of implementing types (as they are subclasses of the abstract class). Since it is a view, it can be pinned permanently on the side. However, if you double-click on a type name here, you are taken to the declaration line of the type. You then have to find the implementation of the abstract method yourself.

Except, you don't have to, with the following trick:

  1. Right-click on the abstract method and click Open Type Hierarchy.1 In the Type Hierarchy view, you will notice the following:
    • All the subtypes of the abstract class type are listed in the primary list (P).2
    • All the members of the abstract class are listed in the secondary list (S).3
    • The abstract method you right-clicked on is selected in the secondary list.4

  2. Click on the Lock View and Show Members in Hierarchy button (1) above the secondary list.
    • The selected method and its implementations will be listed in the primary list under each of the subtypes as well as the parent type.

You can now quickly navigate between implementations by clicking or double-clicking on the methods listed in the primary list.

1 You can also click on the method name and press F4.
2 If they are not listed, click either one of the Show the Type Hierarchy (2) or Show the Subtype Hierarchy (3) buttons above the list.
3 If there's no secondary list, click on the View Menu (4), choose Layout > [any option other than Hierarchy Only].
4 If it is not selected, just click on it to select it.

🌐
GeeksforGeeks
geeksforgeeks.org › java › abstraction-in-java-2
Abstraction in Java - GeeksforGeeks
Java provides two ways to implement abstraction, which are listed below: ... The television remote control is the best example of abstraction. It simplifies the interaction with a TV by hiding all the complex technology. We don't need to understand how the TV internally works; we just need to press the button to change the channel or adjust the volume. ... abstract class TV{ abstract void turnOn(); abstract void turnOff(); } // Concrete class implementing the abstract methods class TVRemote extends TV{ @Override void turnOn(){ System.out.println("TV is turned ON."); } @Override void turnOff(){ System.out.println("TV is turned OFF."); } } // Main class to demonstrate abstraction public class Geeks{ public static void main(String[] args){ TV remote = new TVRemote(); remote.turnOn(); remote.turnOff(); } }
Published   November 14, 2017
🌐
Java Code Geeks
examples.javacodegeeks.com › home › java development › java basics
Java Abstract Class Example - Java Code Geeks
November 9, 2023 - Due to this feature, an Abstract Class is being used in scenarios where a complete implementation can be further broken down into a set of repetitive steps with few unique steps. One such example will be, of URL Processor application which extract the HTML of the website hosted at the URL. ... package URLProcessor; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLConnection; public abstract class URLProcessorBase { public void process(URL url) throws IOException { URLConnection urlConnection = url.openConnection(); InputStream input = urlConnection.getInputStream(); try { processURLData(input); } finally { input.close(); } } protected abstract void processURLData(InputStream input) throws IOException; }
🌐
DataCamp
datacamp.com › doc › java › abstract
abstract Keyword in Java: Usage & Examples
The abstract keyword in Java is used to declare a class or a method that cannot be instantiated directly or must be implemented by subclasses, respectively.
🌐
BeginnersBook
beginnersbook.com › 2013 › 05 › java-abstract-class-method
Abstract Class in Java with example
It can have abstract methods(methods ... have abstract methods. In this guide we will learn what is a abstract class, why we use it and what are the rules that we must remember while working with it in Java....
🌐
Stack Overflow
stackoverflow.com › questions › 28615127 › how-to-deal-with-abstract-classes-and-implementations-in-eclipse
java - How to deal with abstract classes and implementations in Eclipse - Stack Overflow
Having an "effective" view in the concrete class would ease the pain to understand the dungle of abstract classes hiding important details. Looking forward to your answers. :) ... Which implementation? There can be multiple... ... You can type ctrl-O to see the members (fields and methods) of the class, and if you type ctrl-O a second time it will show all the inherited fields and methods.
Top answer
1 of 15
355

An abstract class is a class which cannot be instantiated. An abstract class is used by creating an inheriting subclass that can be instantiated. An abstract class does a few things for the inheriting subclass:

  1. Define methods which can be used by the inheriting subclass.
  2. Define abstract methods which the inheriting subclass must implement.
  3. Provide a common interface which allows the subclass to be interchanged with all other subclasses.

Here's an example:

abstract public class AbstractClass
{
    abstract public void abstractMethod();
    public void implementedMethod() { System.out.print("implementedMethod()"); }
    final public void finalMethod() { System.out.print("finalMethod()"); }
}

Notice that "abstractMethod()" doesn't have any method body. Because of this, you can't do the following:

public class ImplementingClass extends AbstractClass
{
    // ERROR!
}

There's no method that implements abstractMethod()! So there's no way for the JVM to know what it's supposed to do when it gets something like new ImplementingClass().abstractMethod().

Here's a correct ImplementingClass.

public class ImplementingClass extends AbstractClass
{
    public void abstractMethod() { System.out.print("abstractMethod()"); }
}

Notice that you don't have to define implementedMethod() or finalMethod(). They were already defined by AbstractClass.

Here's another correct ImplementingClass.

public class ImplementingClass extends AbstractClass
{
    public void abstractMethod() { System.out.print("abstractMethod()"); }
    public void implementedMethod() { System.out.print("Overridden!"); }
}

In this case, you have overridden implementedMethod().

However, because of the final keyword, the following is not possible.

public class ImplementingClass extends AbstractClass
{
    public void abstractMethod() { System.out.print("abstractMethod()"); }
    public void implementedMethod() { System.out.print("Overridden!"); }
    public void finalMethod() { System.out.print("ERROR!"); }
}

You can't do this because the implementation of finalMethod() in AbstractClass is marked as the final implementation of finalMethod(): no other implementations will be allowed, ever.

Now you can also implement an abstract class twice:

public class ImplementingClass extends AbstractClass
{
    public void abstractMethod() { System.out.print("abstractMethod()"); }
    public void implementedMethod() { System.out.print("Overridden!"); }
}

// In a separate file.
public class SecondImplementingClass extends AbstractClass
{
    public void abstractMethod() { System.out.print("second abstractMethod()"); }
}

Now somewhere you could write another method.

public tryItOut()
{
    ImplementingClass a = new ImplementingClass();
    AbstractClass b = new ImplementingClass();

    a.abstractMethod();    // prints "abstractMethod()"
    a.implementedMethod(); // prints "Overridden!"     <-- same
    a.finalMethod();       // prints "finalMethod()"

    b.abstractMethod();    // prints "abstractMethod()"
    b.implementedMethod(); // prints "Overridden!"     <-- same
    b.finalMethod();       // prints "finalMethod()"

    SecondImplementingClass c = new SecondImplementingClass();
    AbstractClass d = new SecondImplementingClass();

    c.abstractMethod();    // prints "second abstractMethod()"
    c.implementedMethod(); // prints "implementedMethod()"
    c.finalMethod();       // prints "finalMethod()"

    d.abstractMethod();    // prints "second abstractMethod()"
    d.implementedMethod(); // prints "implementedMethod()"
    d.finalMethod();       // prints "finalMethod()"
}

Notice that even though we declared b an AbstractClass type, it displays "Overriden!". This is because the object we instantiated was actually an ImplementingClass, whose implementedMethod() is of course overridden. (You may have seen this referred to as polymorphism.)

If we wish to access a member specific to a particular subclass, we must cast down to that subclass first:

// Say ImplementingClass also contains uniqueMethod()
// To access it, we use a cast to tell the runtime which type the object is
AbstractClass b = new ImplementingClass();
((ImplementingClass)b).uniqueMethod();

Lastly, you cannot do the following:

public class ImplementingClass extends AbstractClass, SomeOtherAbstractClass
{
    ... // implementation
}

Only one class can be extended at a time. If you need to extend multiple classes, they have to be interfaces. You can do this:

public class ImplementingClass extends AbstractClass implements InterfaceA, InterfaceB
{
    ... // implementation
}

Here's an example interface:

interface InterfaceA
{
    void interfaceMethod();
}

This is basically the same as:

abstract public class InterfaceA
{
    abstract public void interfaceMethod();
}

The only difference is that the second way doesn't let the compiler know that it's actually an interface. This can be useful if you want people to only implement your interface and no others. However, as a general beginner rule of thumb, if your abstract class only has abstract methods, you should probably make it an interface.

The following is illegal:

interface InterfaceB
{
    void interfaceMethod() { System.out.print("ERROR!"); }
}

You cannot implement methods in an interface. This means that if you implement two different interfaces, the different methods in those interfaces can't collide. Since all the methods in an interface are abstract, you have to implement the method, and since your method is the only implementation in the inheritance tree, the compiler knows that it has to use your method.

2 of 15
79

A Java class becomes abstract under the following conditions:

1. At least one of the methods is marked as abstract:

public abstract void myMethod()

In that case the compiler forces you to mark the whole class as abstract.

2. The class is marked as abstract:

abstract class MyClass

As already said: If you have an abstract method the compiler forces you to mark the whole class as abstract. But even if you don't have any abstract method you can still mark the class as abstract.

Common use:

A common use of abstract classes is to provide an outline of a class similar like an interface does. But unlike an interface it can already provide functionality, i.e. some parts of the class are implemented and some parts are just outlined with a method declaration. ("abstract")

An abstract class cannot be instantiated, but you can create a concrete class based on an abstract class, which then can be instantiated. To do so you have to inherit from the abstract class and override the abstract methods, i.e. implement them.

🌐
Tutorialspoint
tutorialspoint.com › java › java_abstraction.htm
Java - Abstraction
Java abstract classes may or may not contain abstract methods, i.e., methods without body ( public void get(); ) But, if a class has at least one abstract method, then the class must be declared abstract. If a class is declared abstract, it cannot be instantiated.
🌐
Baeldung
baeldung.com › home › java › core java › abstract classes in java
Abstract Classes in Java | Baeldung
January 8, 2024 - Learn how and when to use abstract classes as part of a class hierarchy in Java.
Top answer
1 of 13
74

Define a constructor in the abstract class which sets the field so that the concrete implementations are per the specification required to call/override the constructor.

E.g.

public abstract class AbstractTable {
    protected String name;
    
    public AbstractTable(String name) {
        this.name = name;
    }
}

When you extend AbstractTable, the class won't compile until you add a constructor which calls super("somename").

public class ConcreteTable extends AbstractTable {
    private static final String NAME = "concreteTable";

    public ConcreteTable() {
        super(NAME);
    }
}

This way the implementors are required to set name. This way you can also do (null)checks in the constructor of the abstract class to make it more robust. E.g:

public AbstractTable(String name) {
    Objects.requireNonNull(name, "Name may not be null");
    this.name = name;
}
2 of 13
55

I think your confusion is with C# properties vs. fields/variables. In C# you cannot define abstract fields, even in an abstract class. You can, however, define abstract properties as these are effectively methods (e.g. compiled to get_TAG() and set_TAG(...)).

As some have reminded, you should never have public fields/variables in your classes, even in C#. Several answers have hinted at what I would recommend, but have not made it clear. You should translate your idea into Java as a JavaBean property, using getTAG(). Then your sub-classes will have to implement this (I also have written a project with table classes that do this).

So you can have an abstract class defined like this...

public abstract class AbstractTable {

    public abstract String getTag();
    public abstract void init();

    ...
}

Then, in any concrete subclasses you would need to define a static final variable (constant) and return that from the getTag(), something like this:

public class SalesTable extends AbstractTable {

    private static final String TABLE_NAME = "Sales";

    public String getTag() {
        return TABLE_NAME;
    }

    public void init() {
        ...
        String tableName = getTag();
        ...
    }

}

EDIT:

You cannot override inherited fields (in either C# or Java). Nor can you override static members, whether they are fields or methods. So this also is the best solution for that. I changed my init method example above to show how this would be used - again, think of the getXXX method as a property.

🌐
Whitman College
whitman.edu › mathematics › java_tutorial › java › javaOO › abstract.html
Writing Abstract Classes and Methods
Similarly in object-oriented programming, you may want to model abstract concepts but you don't want to be able to create an instance of it. For example, the Number class in the java.lang package represents the abstract concept of numbers. It makes sense to model numbers in a program, but it ...