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

About admin

Check Also

Pakistan has how many seasons?

(a) Two seasons (b) Three seasons (c) Four seasons (d) All the year same Correct …