Packages
Last updated
What is Packages?
A package is a namespace that mainly contains classes and interfaces. For instance, the standard class ArrayList is in the package java.util. For this class, java.util.ArrayList is called its fully qualified name because this syntax has no ambiguity. Classes in different packages can have the same name. For example, you have the two classes java.util.Date and java.sql.Date, which are different. If no package is declared in a class, its package is the default package.
To create package use this command -> javac -d directory javafilename
Free resources to learn Packages
- ArticlePackages in Java
More in stage 3: Lambda Expressions
Packages: common questions
Can I learn Packages in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Packages in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this Packages tutorial for beginners?
It is lesson 21 of 86 in the free Java roadmap, in stage 3, Lambda Expressions. If you are new to Java, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.