Firstly, that is a very vague question. What are you trying to do with Java in the first place?!
If you already know it is a programming language, and are asking about whether it is necessary to use the package keyword, at the begining of every java file, then no, you do not need a package to create java files.
If no package keyword is used, the java file is considered to be under the default package. You might also want to understand the need for packages as explained below
Need for packages
1. Namespace partitioning.
Every java file declares one or more classes. Each class should have a unique name in a namespace. The package keyword allows you to partition the namespace and hence ensure uniqueness of the class name.
eg.
Let us say you want to write a HashMap class for you company, which allows duplicates.
However there is already a class called HashMap in java.util package. If you still want to write your own class with the same name you may do so within your own package.
com.somecompany.util.HashMap.
Now each class can be indentified as below
java.util.HashMap hm = new java.util.HashMap();
com.somecompany.util.HashMap hm1 = new com.somecompany.util.HashMap();
2. Grouping of related classes.
Classes providing some common functionality can be groped as a package.
eg.
java.util - Utility classes (collection classes, Stirng etc)
java.lang - Classes implementing language fundamentals
java.io - Input/Output classes.