OOPS 2 - Encapsulation (access modifiers and constructors)
OOPS Access Modifiers: Define the level of protectiveness. Please use below link to download access modifier package for practice. https://github.com/PuneetKumarSinghIT/java.git Constructors: The first method which will trigger whenever you are creating an object of an class. It will define memory for your class object as class is a blueprint and object is real look of that blueprint which live. Java will cancel default constructor once you create one of your own parameters list. Responsibility of constructors: Create object of a class. assign default values to attributes of a class. example: int x =0; -> primitive datatype Integer x = null; -> class So constructor responsibility of constructor is to assign default values if datatype is promitive and null if datatype is derived or wrapper class object. Syntax to create a constructor: class puneet{ public puneet() { } } You can have paremeters or not for your constructor, calling your constructor will be done at the time of o...