+ 1
Rituram Ojha You have not declared your "name" variable but accessing it inside the class. Also you have getter and setter that you are not using in the main(). Edit: Constructors are methods which are called at the time of object creation. Also you need not explicitly define a constructor if you don't want because an implicit default constructor is provided by the compiler which has no parameters.
27th Nov 2019, 2:37 AM
Avinesh
Avinesh - avatar