Yes, we can create concreate method in the abstract class. To prevent a class from directly creating objects, it is better declare that as abstract classes. As HttpServlet.
abstract class Hello {
public void test() {
System.out.println("abstract class without abstract method");
}
}
public class ExampleHello extends Hello {
public static void main(String[] args) {
Hello d = new ExampleHello();
d.test();
}
}
Output :-
abstract class without abstract method
good articles