Given the following class class Base int Age 33 How you can-04111
Given the following class <br>class Base{ <br>int Age=33; <br>} <br>How you can improve above class with respect to accessing the field Age?
This multiple choice question (MCQ) is related to the book/course vu cs304 Object Oriented Programming. It can also be found in vu cs304 Mid Term - Quiz No.2.
Given the following class
class Base{
int Age=33;
}
How you can improve above class with respect to accessing the field Age?
class Base{
int Age=33;
}
How you can improve above class with respect to accessing the field Age?
Define the variable Age as private
Define the variable Age as protected
Define the variable Age as private and create a get method that returns it and a set method that updates it
Define the variable Age as protected and create a set method that returns it and a get method that updates it