Java

Table of Contents

Java

Package

An object belongs to a package.

package org.example.pckg;

public class Class1 {
}

Calling an object within the same package in a different file creates a dependency.

package org.example.pckg;

public class ClassB {
  private Class1 c;
}
Import

Import instructions are used to build a source file scope. If a visible object from this package is used, a dependency to the file containing this object is created.

package org.example.pckgTwo;

import org.example.pckg;

public class Class2 {
  private Class1 c;
}