Access Modifiers and Static Keyword
Objective:
You will learn different type of access modifiers and their usage.
Topics:
- Access Modifiers – public, default(package-private), private and protected – What are Access Modifiers, When and How are they used?
- static keyword – When do we use static keyword in front of variables, methods and inner classes and when we don’t?
- Rules related to static keyword – static method vs non static method.
- static initializer block for static variable initialization and constructor for non-static variable initialization.
- Why is main method static, Why methods in java.lang.Math API static or in general what all methods are static in APIs?
