Given the following class Base{into Age=32 ;} How you can improve above class with respect to accessing the field Age

A. Define the variable Age as private

B. Define the variable Age as private and create a get method that return it and a set method that updates it

C. Define the variable Age as protected

D. None of given

See Correct Answer

B. Define the variable Age as private and create a get method that return it and a set method that updates it

Submitted By : Ahsan Ali Soomro

%d bloggers like this: