Access modifiers

description of image


Access modifiers


In this lesson, we will learn about two Keywords: public and private.

These keywords (access modifiers) determine whether a method /field can be accessed from other classes or not.

Private members can be accessed only from within the class

Public members can be accessed From anywhere



Quiz


Question Text