Index


Introduction

A package is simply a container that groups related types (Java classes, interfaces, enumerations, and annotations


Built-in Package

Built-in packages are existing java packages that come along with the JDK.

For example, java.lang, java.util, java.io, etc. For example:

import java.util.ArrayList;
 
class ArrayListUtilization {
    public static void main(String[] args) {
 
        ArrayList<Integer> myList = new ArrayList<>(3);
        myList.add(3);
        myList.add(2);
        myList.add(1);
 
        System.out.println(myList);
    }
}

oss

You don’t need to import java.lang because it’s already integrated with the java environment