1.

How we can create packages in Java?

Answer»

Here are the steps for creating a package:

  • Choose a name for the package
  • On top of every SOURCE FILE, put the package statement with the package name. Source file must contain CLASSES and types that you want in the package.
  • Package statement is the first LINE of source file.
  • You can only have one package statement in each file
  • It applies to all file types.


Discussion

No Comment Found