Learn Java Programming

Widely Used: Java is one of the most popular programming languages used by millions of developers worldwide.

Building Applications: Java is used in various applications, including mobile apps, web development, desktop applications, and large-scale enterprise systems.

Platform Independence: Java’s “Write Once, Run Anywhere” feature allows you to run your applications on any device with a Java Virtual Machine (JVM).

Strong Community Support: A large and active community provides extensive resources, libraries, and frameworks to help you learn and develop in Java.

Job Opportunities: Knowledge of Java can open up numerous job opportunities in various industries, as employers highly demand it.

Object-Oriented: Java’s object-oriented structure makes it easier to manage and maintain code by promoting modularity and reusability.

Security: Java provides robust security features that help in developing secure applications.

Rich API: Java offers a comprehensive set of APIs for almost everything, from networking to data structures, making development easier.

Strong Memory Management: Automatic garbage collection helps in managing memory efficiently, reducing the risk of memory leaks.

Scalability: Java is suitable for developing both small applications and large, complex systems due to its scalability and reliability.

Check out 1000+ Java API guides: Java API Documentation.

This tutorial covers everything about the Java programming language. It is designed for beginners and professionals who want to learn Java from scratch.

Java Basics

Control Flow Statements

Java Arrays and Strings

Java OOPs

Java Misc

Java Exception Handling

Java Collections Framework

Java Multithreading

Java Release-Wise Features

Guides on Java 8 Features

Guides on Java 9 Features

Guides on Java 10 Features

Guides on Java 11 Features

Guides on Java 12 Features

Guides on Java 13 to 22 Features

Java API Documentation

Java Programs with Output

Commonly Used Java Methods/APIs

Java Lang Package – Important Classes and its Methods/APIs

ClassDescription
Java String Class MethodsProvides methods to manipulate and handle string data.
Java Object Class MethodsDefines the root class of the Java class hierarchy.
Java Integer Class MethodsProvides methods for converting int values and working with Integer objects.
Java Double Class MethodsProvides methods for converting double values and working with Double objects.
Java Long Class MethodsProvides methods for converting long values and working with Long objects.
Java Boolean Class MethodsProvides methods for converting boolean values and working with Boolean objects.
Java Character Class MethodsProvides methods for working with char values.
Java Short Class MethodsProvides methods for converting short values and working with Short objects.
Java Byte Class MethodsProvides methods for converting byte values and working with Byte objects.
Java Class MethodsProvides methods for working with Java class objects.
Java Thread Class MethodsProvides methods for managing and controlling threads.
Java Math Class MethodsProvides methods for performing basic numeric operations.
Java System Class MethodsProvides access to system-related resources and properties.
Java Package Class MethodsProvides methods to get information about the implementation and specification of a package.
Java ThreadLocal Class MethodsProvides thread-local variables.
Java ThreadGroup Class MethodsProvides methods for managing groups of threads.
Java Throwable Class MethodsProvides methods for handling exceptions and errors.
Java Enum Class MethodsProvides methods for working with enum types.
Java CompletableFuture MethodsProvides methods for asynchronous programming.
Java Executors Class MethodsProvides factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory, and Callable classes.
Java ThreadPoolExecutor Class MethodsProvides methods for managing a pool of threads.
Java StringBuilder MethodsProvides methods for manipulating sequence of characters.
Java StringTemplate Class MethodsProvides methods for template-based string operations.

Java Util Package – Important Classes and it’s Methods/APIs

ClassDescription
Java ArrayList Class MethodsProvides methods for managing dynamic arrays.
Java HashMap Class MethodsProvides methods for managing hash tables and key-value pairs.
Java Scanner Class MethodsProvides methods for parsing primitive types and strings using regular expressions.
Java LinkedList Class MethodsProvides methods for managing linked lists.
Java HashSet Class MethodsProvides methods for managing sets backed by a hash table.
Java LinkedHashSet Class MethodsProvides methods for managing linked hash sets.
Java CopyOnWriteArraySet Class MethodsProvides methods for managing thread-safe sets where elements cannot be changed once added.
Java PriorityQueue Class MethodsProvides methods for managing priority queues.
Java EnumSet Class MethodsProvides methods for managing sets of enum types.
Java LinkedHashMap Class MethodsProvides methods for managing linked hash maps.
Java TreeMap Class MethodsProvides methods for managing maps sorted according to the natural ordering of its keys.
Java EnumMap Class MethodsProvides methods for managing specialized maps with enum keys.
Java ConcurrentHashMap Class MethodsProvides methods for managing thread-safe hash tables.
Java CopyOnWriteArrayList Class MethodsProvides methods for managing thread-safe lists where elements cannot be changed once added.
Java Stack Class MethodsProvides methods for managing last-in-first-out (LIFO) stacks.
Java Currency Class MethodsProvides methods for working with currency values.
Java Objects Class MethodsProvides methods for working with objects and performing operations such as comparisons and null checks.
Java Arrays Class MethodsProvides utility methods for manipulating arrays (such as sorting and searching).
Java Collections Class MethodsProvides static methods that operate on or return collections. It includes methods for tasks such as sorting, searching, reversing, and synchronizing collections.

Java Util Function Package – Important Classes and it’s Methods/APIs

ClassDescription
Java Stream MethodsProvides methods for working with streams, allowing functional-style operations on sequences of elements.
Java Collectors Class MethodsProvides implementations of reduction operations, such as accumulating elements into collections.
Java IntStream MethodsProvides methods for working with streams of primitive int values.
Java LongStream MethodsProvides methods for working with streams of primitive long values.
Java DoubleStream MethodsProvides methods for working with streams of primitive double values.

Java Time Package – Important Classes and it’s Methods/APIs

ClassDescription
Java LocalDate Class MethodsProvides methods for working with dates (year, month, day) without a time-zone.
Java LocalTime Class MethodsProvides methods for working with times (hour, minute, second, nanosecond) without a time-zone.
Java LocalDateTime Class MethodsProvides methods for working with date-times without a time-zone.
Java ZonedDateTime Class MethodsProvides methods for working with date-times with a time-zone.
Java Instant Class MethodsProvides methods for working with a specific moment in time.
Java Duration Class MethodsProvides methods for working with time-based amounts of time.
Java Clock Class MethodsProvides methods for accessing the current instant, date, and time using a time-zone.

List of All Java Keywords

KeywordDescription
byteUsed to declare a variable that can hold an 8-bit signed integer.
shortUsed to declare a variable that can hold a 16-bit signed integer.
intUsed to declare a variable that can hold a 32-bit signed integer.
longUsed to declare a variable that can hold a 64-bit signed integer.
floatUsed to declare a variable that can hold a 32-bit floating-point number.
doubleUsed to declare a variable that can hold a 64-bit floating-point number.
charUsed to declare a variable that can hold a single 16-bit Unicode character.
booleanUsed to declare a variable that can hold a value of true or false.
varUsed to declare a variable with inferred type (introduced in Java 10).
ifUsed to define a conditional statement or block.
elseUsed in conjunction with if to specify an alternative block of statements.
forUsed to define a loop that executes a block of statements a specified number of times.
whileUsed to define a loop that continues to execute as long as its condition is true.
doUsed to define a do-while loop, which executes a block of statements once before checking its condition.
switchUsed to define a switch block that selects one of many possible blocks of code to execute.
caseUsed within a switch block to define a branch.
breakUsed to exit from a loop or switch block prematurely.
continueUsed to skip the current iteration of a loop and proceed to the next iteration.
defaultUsed in a switch block to specify the default case or to define default methods in interfaces (from Java 8).
yieldUsed in switch expressions to return a value (introduced in Java 13).
classUsed to define a class in Java.
newUsed to create new objects.
staticUsed to declare static members that belong to the class rather than any instance.
interfaceUsed to define an interface.
extendsUsed to indicate that a class is inheriting from a superclass.
implementsUsed to implement an interface.
superUsed to refer to superclass members.
thisUsed to refer to the current object.
abstractUsed to declare abstract classes and methods.
finalUsed to declare constants and prevent inheritance.
packageUsed to define a package for the class.
enumUsed to define a fixed set of constants.
privateUsed to declare private fields and methods.
protectedUsed to declare protected fields and methods.
publicUsed to declare public classes, fields, methods, and constructors.
tryUsed to define a block of code to be tested for exceptions.
catchUsed to define a block of code to handle exceptions.
finallyUsed to define a block of code to be executed after a try block, regardless of whether an exception is thrown or not.
throwUsed to explicitly throw an exception.
throwsUsed to declare the exceptions that a method can throw.
synchronizedUsed to declare synchronized blocks or methods to control the access of multiple threads to shared resources.
volatileUsed to indicate that a variable’s value will be modified by different threads.
moduleUsed to define a module (introduced in Java 9).
exportsUsed to export all public members of a package in a module.
requiresUsed to specify required libraries inside a module.
openUsed to create an open module that grants reflective access to other modules.
opensUsed to expose specific packages for reflective access by other modules.
usesSpecifies the services consumed by the current module.
providesSpecifies services provided by the current module.
sealedUsed to define sealed classes and interfaces (introduced in Java 17).
non-sealedUsed to define non-sealed classes and interfaces.
permitsUsed to specify the subclasses that can extend the sealed class directly.
voidIndicates that a method does not return any value.
returnUsed to exit from a method and optionally return a value.
transientUsed in serialization to indicate that a variable should not be serialized.
strictfpEnsures strict precision of floating-point calculations across different platforms.
importUsed to import other Java packages or classes into the current file.
instanceofUsed to test whether an object is an instance of a specific class or implements an interface.
nativeSpecifies that a method is implemented in native code using JNI.
recordUsed to define a special type of class that acts as a data carrier (introduced in Java 14).
assertUsed to make an assertion in debugging.
constReserved but not used in Java.
gotoReserved but not used in Java.
_From Java 9, _ (underscore) is a keyword and cannot be used as an identifier.
Scroll to Top