• Yes.
  • Declaring a class abstract without abstract methods means that you don't allow it to be instantiated on its own.
  • The abstract class used in java signifies that you can't create an object of the class directly.
  • This will work:
    public abstract class abs {

    protected int s=0;

    public void display() {
        System.out.print("hello");
    }

    }


Instance Of Java

We are here to help you learn! Feel free to leave your comments and suggestions in the comment section. If you have any doubts, use the search box on the right to find answers. Thank you! 😊
«
Next
Write a program to String reverse without using any string Api?
»
Previous
what are the differences between Final , finally finalize()?

2 comments for Can you define an abstract class without any abstract methods? if yes what is the use of it?

  1. blogger_logo_round_35

    which means concrete method???

    ReplyDelete
  2. blogger_logo_round_35

    But in what scenarios defining an abstract class without abstract methods will be useful ?

    ReplyDelete

Select Menu