Cannot instantiate the type for class object (Java)

following are few main points about abstract classes

  1. An abstract class is a class that is declared abstract.
  2. It may or may not include abstract methods.
  3. Abstract classes cannot be instantiated, but they can be subclassed
  4. Abstract classes does not contains any constructor

in your case there is a abstract class declared as public abstract class Killer so as its declaration defines that it is public, abstract class with named as Killer so as it is stated earlier that an Abstract classes cannot be instantiated so you need to subclass it or remove abstract keyword in order to get its instance for further read oracle docs abstract classes


We can't instantiate abstract class. It's characteristics of abstract class. Here it's abstract so.