read the message of the error of the compiler!
Implicit super constructor Base() is undefined. Must explicitly invoke
another constructor
your child class must call the constructor of the parent class
Child(int b) {
super(b);
this.b = b;
}
More Related Contents:
- Implicit super constructor Event() is undefined [duplicate]
- What’s wrong with overridable method calls in constructors?
- Java Constructor Inheritance
- In what order do static blocks and initialization blocks execute when using inheritance?
- Inheritance in Java – creating an object of the subclass invokes also the constructor of the superclass. Why exactly?
- State of Derived class object when Base class constructor calls overridden method in Java
- Why are constructors not inherited in java?
- order of constructor calls in multilevel inheritance in java [duplicate]
- how to inherit Constructor from super class to sub class
- Does an instance of superclass get created when we instantiate an object?
- Initialize field before super constructor runs?
- At runtime, find all classes in a Java application that extend a base class
- Why java classes do not inherit annotations from implemented interfaces?
- Calling a subclass method from superclass
- What is the main difference between Inheritance and Polymorphism?
- Most efficient way to cast List to List
- Good reasons to prohibit inheritance in Java?
- Use of Initializers vs Constructors in Java
- Can constructor return a null object?
- Why does the “protected” modifier in Java allow access to other classes in same package?
- How do Java method annotations work in conjunction with method overriding?
- Hiding Fields in Java Inheritance
- Why do abstract classes in Java have constructors? [duplicate]
- Building a copy constructor in Java
- Why do constructors in java not have a return type? [duplicate]
- Is doing a lot in constructors bad? [closed]
- stackoverflow error in class constructor
- Java generic method inheritance and override rules
- How can I access a private constructor of a class?
- Java: Use import or explicit package / class name?