Please disable adblock to view this page.

← Go home

Implementing Package in Java


April 29, 2017
Published By : Pratik Kataria
Categorised in:

What is a package?

  • A package is a namespace concept which organizes a set of related interfaces and classes.
  • It can be thought of as different folders on your system.

Implementing Package


public class Main {
	public static void main( String[] args) {
  • This file needs to be kept inside folders:
    • com -> pratikkataria -> java ->
  • So the command prompt needs to be started in the location where the com folder is:
    • K:\>
    • K:\>javac com\pratikkataria\java\
    • K:\>java MyArg
    • MyArg