- 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");
}
}
which means concrete method???
ReplyDeleteBut in what scenarios defining an abstract class without abstract methods will be useful ?
ReplyDelete