There are no strict rules for the selection, in fact, there are no rules followed. Classes that popped up on top of mind are listed below. You are welcome to add your own list. This list will vary depending on the type of java project you work on.
1. java.lang.String
String s="Java Guides";
String str = new String("Java Guides");
Read more about Java String class and it's methods with examples at Java String Class API Guide.
JavaDoc at https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html.
2. java.lang.Object
The Object class, in the java.lang package sits at the top of the class hierarchy tree. Every class is a descendant, direct or indirect, of the Object class. Every class you use or write inherits the instance methods of Object. You need not use any of these methods, but, if you choose to do so, you may need to override them with code that is specific to your class.Read more about Java Object class and it's methods with examples at Object Class Methods in Java with Examples.
Javadoc at https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html.
3. java.lang.Thread
Thread class is used to create a new thread of execution. It implements the Runnable interface. The Java Virtual Machine allows an application to have multiple threads of execution running concurrently.Read more about Java Thread class and it's methods with examples at Thread Class in Java with Examples.
Javadoc at https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Thread.html.
4. java.util.ArrayList
- Java ArrayList class can contain duplicate elements.
- Java ArrayList class maintains insertion order.
- Java ArrayList class is non-synchronized.
- Java ArrayList allows random access because array works at the index basis.
- In Java ArrayList class, manipulation is slow because a lot of shifting needs to have occurred if any element is removed from the array list.
5. java.util.HashMap
- A HashMap contains values based on the key.
- It contains only unique elements.
- It may have one null key and multiple null values.
- It maintains no order.
- Java HashMap is not thread-safe. You must explicitly synchronize concurrent modifications to the HashMap.
Javadoc at https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/HashMap.html.
6. java.lang.Exception
7. java.util.HashSet
- HashSet stores the elements by using a mechanism called hashing.
- HashSet contains unique elements only.
- Difference between List and Set
- List can contain duplicate elements whereas Set contains unique elements only.
8. java.lang.StringBuilder
9. java.util.Arrays
- This class contains various methods for manipulating arrays (such as sorting and searching).
- The methods in this class throw a NullPointerException if the specified array reference is null.
10. java.util.Collections
11. java.time.LocalDate
12. java.time.LocalDateTime
13. java.nio.file.Files
The Java NIO Files class (java.nio.file.Files) provides several methods for manipulating files in the file system. This class consists exclusively of static methods that operate on files, directories, or other types of files.The File class has several methods for working with directories and files such as creating new directories or files, deleting and renaming directories or files, listing the contents of a directory, etc.
15. java.util.Scanner
Scanner class in Java is found in the java.util package. Java provides various ways to read input from the keyboard, the java.util.Scanner class is one of them.The Java Scanner class breaks the input into tokens using a delimiter which is whitespace by default. It provides many methods to read and parse various primitive values.
The Java Scanner class is widely used to parse text for strings and primitive types using a regular expression. It is the simplest way to get input in Java. By the help of Scanner in Java, we can get input from the user in primitive types such as int, long, double, byte, float, short, etc.
16. java.lang.System
The System class of java contains several useful class fields and methods. It also provides facilities like standard input, standard output, and error output Streams. It can't be instantiated. The Java System class comes in the module of "java.base" & in the package of "java.lang".17. java.util.Iterator
This is an interface. It is very popular and came as a replacement for Enumeration. It is simple to use convenience utility and works in sync with Iterable. It was introduced in JDK 1.2.18. java.lang.Runnable
The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread. The class must define a method of no arguments called run. This is a functional interface and therefore it can be used as the assignment target for a lambda expression or method reference.19. java.lang.Class
Instances of the class Class represent classes and interfaces in a running Java application. An enum type is a kind of class and an annotation type is a kind of interface. Every array also belongs to a class that is reflected as a Class object that is shared by all arrays with the same element type and number of dimensions. The primitive Java types (boolean, byte, char, short, int, long, float, and double), and the keyword void are also represented as Class objects. void printClassName(Object obj) {
System.out.println("The class of " + obj +
" is " + obj.getClass().getName());
}
20. java.net.HttpURLConnection
HttpURLConnection class from java.net package can be used to send Java HTTP Request programmatically. Check out Java HttpURLConnection Class Example – Java HTTP Request GET, POST article, here you will see how to use HttpURLConnection in java program to send GET and POST requests and then print the response.21. java.io.BufferedReader
Java BufferedReader class is used to read the text from a character-based input stream. It can be used to read the data line by line by readLine() method. It makes the performance fast.22. java.net.URL
Class URL represents a Uniform Resource Locator, a pointer to a "resource" on the World Wide Web. A resource can be something as simple as a file or a directory, or it can be a reference to a more complicated object, such as a query to a database or to a search engine.23. java.io.IOException
This class signals that an I/O exception of some sort has occurred. This class is the general class of exceptions produced by failed or interrupted I/O operations.24. java.util.LinkedList
- Java LinkedList class can contain duplicate elements.
- Java LinkedList class maintains insertion order.
- In Java LinkedList class, manipulation is fast because no shifting needs to have occurred.
- The LinkedList class implements Queue and Deque interfaces. Therefore, It can also be used as a Queue, Deque or Stack.
- Java LinkedList is not thread-safe. You must explicitly synchronize concurrent modifications to the LinkedList in a multi-threaded environment.
25. java.util.concurrent.Executors
- Methods that create and return an ExecutorService set up with commonly useful configuration settings.
- Methods that create and return a ScheduledExecutorService set up with commonly useful configuration settings.
- Methods that create and return a "wrapped" ExecutorService, that disables reconfiguration by making implementation-specific methods inaccessible.
- Methods that create and return a ThreadFactory that sets newly created threads to a known state.
- Methods that create and return a Callable out of other closure-like forms, so they can be used in execution methods requiring Callable.
26. java.util.Optional class
Advantages of Java 8 Optional:
- Null checks are not required.
- No more NullPointerException at run-time.
- We can develop a clean and neat APIs.
- No more Boilerplate code
27. java.util.stream.Stream
Continue Learning with Java Guides
Want to take your programming skills to the next level? Explore my practical Udemy courses on Java, Spring Boot, Microservices, Full-Stack Development, Docker, and Generative AI. You can also follow my structured learning roadmaps to become a professional developer.
By Ramesh Fadatare - Udemy Instructor Partner

Comments
Post a Comment
Leave Comment