Given the following class class Base { int Age=33; } 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 protected
(C) Define the variable Age as private and create a get method that returns it and a set method that updates it
(D) Define the variable Age as protected and create a set method that returns it and a get method that updates it

»Important Links:

Latest Jobs in PakistanGovt Jobs in PakistanPrivate Jobs in Pakistan
NTS JobsPPSC JobsFPSC Jobs
Teaching JobsNADRA JobsBank Jobs
English McqsGeneral Knowledge McqsPak Studies Mcqs
Current Affairs McqsCurrent Affairs Mcqs PDFCurrent Affairs of Pakistan
Books PDFNotes PDFIslamic Studies Mcqs

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!