Add this to your class:
public WeightIn(){
}
- Please understand that default no-argument constructor is provided only if no other constructor is written
- If you write any constructor, then compiler does not provided default no-arg constructor. You have to specify one.
More Related Contents:
- Constructors giving me an headache Java
- Why i can’t initialize variable in parent class’ constructor? [closed]
- Java error when I try to create an object with a constructor with a string parameter [closed]
- Java default constructor
- Why are my fields initialized to null or to the default value of zero when I’ve declared and initialized them in my class’ constructor?
- Are fields initialized before constructor code is run in Java?
- Is it unnecessary to put super() in constructor?
- Constructor overloading in Java – best practice
- Calling method from constructor
- Methods vs Constructors in Java
- Leaking this in constructor warning
- Why is Class.newInstance() “evil”?
- Is it good practice to make the constructor throw an exception? [duplicate]
- Can I use Class.newInstance() with constructor arguments?
- In what order do static blocks and initialization blocks execute when using inheritance?
- Can I call methods in constructor in Java?
- Why is constructor of super class invoked when we declare the object of sub class? (Java)
- Is it OK to call abstract method from constructor in Java? [duplicate]
- State of Derived class object when Base class constructor calls overridden method in Java
- Horrendous performance & large heap footprint of Java 8 constructor reference?
- constructor of subclass in Java
- How to get the parameter names of an object’s constructors (reflection)? [duplicate]
- How many objects are created due to inheritance in java?
- Protected constructor and accessibility
- Creation of Objects: Constructors or Static Factory Methods
- Passing “this” in java constructor
- Cannot instantiate the type for class object (Java)
- implicit super constructor Person() is undefined. Must explicitly invoke another constructor?
- Create new object using reflection?
- Difference between a no-arg constructor and a default constructor in Java