Normal Import:-
- Explicit Import: syntax:
import.packagename.classname;
example: import java.util.ArrayList;
2. Implicit Import: syntax:
import packagename.*;
example: import java.util.*;
Static Import:-
1. Explicit static import: syntax:
import static packagename.class.staticmember;
example: import static java.lang.Math.sqrt;
import static java.lang.System.out;
2. Import static import : syntax:
import static packagename.classname.*;
example: import static java.lang.Math.*;
import static java.lang.System.*;
No comments:
Post a Comment