Packages Introduction
- A package is a namespace that organizes a set of related classes, interfaces, enums, and annotations.
Organizing Package Names
- Package name is a combination of multiple words separated by dot (.) symbol.
Exploring Compilation
Syntax
Other Directory
Creating package in OTHER DIRECTORY IN OTHER DRIVES
Exploring CLASSPATH
- CLASSPATH represents the path where class files, package s, or JAR files are available.
Importing Packages
- If you want to access one class from another class within the same package, then you can access directly without using any package name.
Static Imports
- Static Import is a new feature introduced in Java 5.
JAR (Java Archive)
Points
Summary — Package Statements
1. Packages can be used
Access Modifiers
- Access modifiers can be used to specify the scope or visibility of the class or members of the class.
Method Overriding
- Method overriding is a process of implementing superclass methods in subclass with the same signature.
SUMMARY
1)
Dynamic Dispatch
The process of assigning subclass object to superclass reference variable is called as dynamic dispatch.
Abstract Classes and Abstract Methods
- abstract is a keyword.
Interfaces
- interface is a keyword which is used to define User Defined Datatypes.
SUMMARY
1. Runtime polymorphism can be achieved using an instance method with a superclass reference variable which contains a subclass object. Then method calls depend on the type of object available in the variable.
Inner Classes
When you define a class within another class then it is called as inner class or nested class.