33.static Import in Java
33.static Import in Java
Vishnu
Static import is a feature which provides the facility to access static members of a class
directly without using class name.
Example:
Display.java
packagecom.sst;
Test
packagecom.sst.exceptions;
Output:
Hello Java
1
Sri Sureka Technologies, NearAndraBank,Opposite Geethanjali High School, Near S.R.Nagar
UmeshChandraStachu, S.R.Nagar, Hyderabad-500038, Ph: 040-66616677, Mobile: +91-9885602332.
33. Static import By Mr. Vishnu
It reduces the code by removing the need of class name to access static data members.
2
Sri Sureka Technologies, NearAndraBank,Opposite Geethanjali High School, Near S.R.Nagar
UmeshChandraStachu, S.R.Nagar, Hyderabad-500038, Ph: 040-66616677, Mobile: +91-9885602332.