Answer :
You need to declare the "name" instance variable in this class definition. Non-static variables defined outside of a class's methods, constructors, or blocks are known as instance variables in Java. In every instance of the class that has been instantiated, that variable exists separately.
An instance variable belongs to a class. When an object is formed, an instance variable likewise gets created, and the same thing happens when an item is destroyed. An instance variable's life depends on the life of an object.
• Only objects that have been created can use instance variables.
• Each object will have a unique instance variable copy.
• Instance variable initialization is not required. Instance variables are used when a variable has to be known by different methods in a class and can have access modifiers assigned. The default value is zero. The declaration is made in a class outside of any method, function
Object() { [native code] }, or block.
To learn more about class definition click here:
brainly.com/question/30030420
#SPJ4