import keyword in Java | Core Java Online Training

This Core Java Online Training “import keyword in Java” providing what is the use of import keyword and how to use import statement in java to connect classes of different packages.


 

import keyword :

  • It is a pre defined keyword in Java.
  • It is used to connect classes of different packages.
  • import statement creates an internal pointer to either ‘package’ or to ‘class.
  • Using internal pointer, it loads the class dynamically while application is running.

import in java

 

  • We can connect only class using import if it is public.
  • We can apply only ‘public’ modifier to class explicitly.

 

  • If class is package level, compiler supplies ‘package level’ default constructor.
  • If class is public, default constructor is also public.

If class is public, constructor is also public

 

Share this