Java tutorials
Java is a versatile, object-oriented programming language created by Sun Microsystems (now owned by Oracle). Renowned for its platform independence through the "write once, run anywhere" principle enabled by the Java Virtual Machine (JVM), Java is a go-to choice for developing web applications, enterprise software, and mobile apps. Its robustness, scalability, and extensive ecosystem have made it a cornerstone of software development worldwide.
E-books
Java offers a rich set of features, including automatic memory management through garbage collection, multithreading capabilities for concurrent programming, and a comprehensive standard library that simplifies tasks such as data manipulation, networking, and file handling. With its strong emphasis on security and backward compatibility, Java has remained a top choice for building reliable and long-lasting applications across diverse industries.
Widely used in enterprise environments, Java powers some of the world's largest banking, e-commerce, and healthcare systems. It is also integral to Android app development through the Android SDK. With a plethora of frameworks like Spring, Hibernate, and JavaFX, as well as an active developer community, Java continues to thrive as a powerful and adaptable language for modern software development.
Tutorials by topic
The tutorials are grouped by topic. The Java tutorial is a complete introduction to the language; the articles below cover individual topics in depth.
Language basics
The basics of the language: its lexical structure, data types, operators, type conversions, control flow, arrays, methods, and packages, together with newer syntax such as switch expressions, text blocks, and unnamed variables.
- Java tutorial
- Java basics
- Java lexical structure
- Java data type
- Java type conversions
- Java type promotions
- Java float types
- Java Autoboxing & Unboxing
- Java operator
- Java Flow Control
- Java Switch Expression
- Java Array
- Java Method
- Java static keyword
- Java enum type
- Java Package
- Java Text Block
- Java Unused Variables
- Java console application
- Java JAR
- Java Pitfalls
- The history of element iteration
- Java 11 new features
Object-oriented programming
Classes, records, interfaces, and sealed hierarchies, object equality and ordering, annotations, and object serialization.
Exceptions
Checked and unchecked exceptions, common runtime exceptions, and automatic resource management with try-with-resources.
Strings and formatting
Creating, joining, splitting, and building strings, regular expressions, and formatting numbers, lists, and locale-specific values.
Collections
Lists, sets, and maps from the collections framework, and common tasks such as filtering, sorting, converting, and iterating over them.
- Java collection
- Java ArrayList
- Java HashSet
- Java HashMap
- Java TreeMap
- Java HashMap merge
- HashMap iteration in Java
- Java filter map
- Filtering a list in Java
- Java sort list
- Java List to String
- Java List to HashMap
- Java forEach
- Java external/internal iterator
- Java Splititerator
- Java Splititerator parallel
Lambdas and functional interfaces
Lambda expressions, variable capture, and the core functional interfaces of the java.util.function package, together with Optional.
Streams
The Stream API: creating streams and transforming, filtering, sorting, matching, and reducing their elements.
- Java Stream
- Java Stream iterate
- Java Stream generate
- Java Stream boxed
- Java Stream Identity Function
- Java Stream map
- Java Stream mapMulti
- Java Stream flatMap
- Java Stream flatMap vs mapMulti
- Java Stream mapToInt
- Java Stream mapToObj
- Java Stream filter
- Java Stream sorted
- Java Stream distinct
- Java Stream peek
- Java Stream skip
- Java Stream limit
- Java Stream Matching
- Java Stream findFirst/findAny
- Java Stream reduce
- Java Stream collect
Files and I/O
Working with files and directories through the java.nio.file API, and reading and writing data with streams, readers, and writers.
- Java file
- Java Path
- Creating file in Java
- Java create directory
- Copying file in Java
- Java append file
- Java file size
- Java file time
- Java list directory contents
- Java Files.list
- Java Files.walk
- Java DirectoryStream
- Java SimpleFileVisitor
- Reading text files in Java
- Java InputStream
- Java FileInputStream
- Java FileOutputStream
- Java InputStreamReader
- Java BufferedReader
- Java FileReader
- Java FileWriter
- Java ZipInputStream
- Java ByteBuffer
- Java Scanner
- Java Console
- Apache FileUtils
Date and time
Dates, times, time zones, and Unix time with the java.time API, including formatting and date adjustments.
Concurrency
Threads, futures, atomic variables, the volatile and synchronized keywords, and synchronizers such as semaphores, latches, and barriers.
Utilities
Random numbers, unique identifiers, Base64 encoding, configuration and resource files, and running external processes.
Algorithms
Classic sorting algorithms and other small algorithmic programs implemented in Java.
JSON, XML, and documents
Reading and writing JSON, XML, CSV, Markdown, Excel, and PDF documents.
Databases
Accessing relational and document databases from Java.
Networking and web
HTTP clients, sockets, e-mail, servlets, embedded web servers, web frameworks, template engines, and HTML parsing.
- Java HttpClient
- Java GET/POST
- Reading a web page in Java
- Java Socket
- Java mail
- Java Servlet
- Java Servlet tutorial series
- Java RequestDispatcher
- Validation filter
- Hibernate Validator
- Embedded Tomcat
- Jetty tutorial
- Java Undertow
- Introduction to Spark
- FreeMarker tutorial
- Jinjava tutorial
- Jsoup tutorial
Testing, logging, and libraries
Unit testing, logging, and general-purpose third-party libraries.
GUI, graphics, and games
Desktop GUIs with Swing, 2D graphics, images, charts, games, and Android.
Java lang API
- Java AutoCloseable interface
- Java Boolean class
- Java Byte class
- Java Character class
- Java CharSequence interface
- Java Class class
- Java Comparable interface
- Java Deprecated annotation
- Java Double class
- Java Enum class
- Java Error class
- Java Exception class
- Java Float class
- Java Integer class
- Java Iterable interface
- Java Long class
- Java Math class
- Java Number class
- Java Object class
- Java Override annotation
- Java Package class
- Java Process class
- Java ProcessBuilder class
- Java Runnable interface
- Java Runtime class
- Java RuntimeException class
- Java Short class
- Java StrictMath class
- Java String class
- Java StringBuffer class
- Java StringBuilder class
- Java SuppressWarnings annotation
- Java System class
- Java Thread class
- Java ThreadLocal class
- Java Throwable class
- Java Void class
Java io API
- Java BufferedInputStream class
- Java BufferedOutputStream class
- Java BufferedReader class
- Java BufferedWriter class
- Java ByteArrayInputStream class
- Java ByteArrayOutputStream class
- Java CharArrayReader class
- Java CharArrayWriter class
- Java CharConversionException class
- Java Closeable interface
- Java Console class
- Java DataInput interface
- Java DataInputStream class
- Java DataOutput interface
- Java DataOutputStream class
- Java EOFException class
- Java Externalizable interface
- Java File class
- Java FileDescriptor class
- Java FileFilter interface
- Java FileInputStream class
- Java FilenameFilter interface
- Java FileNotFoundException class
- Java FileOutputStream class
- Java FileReader class
- Java FileWriter class
- Java FilterInputStream class
- Java FilterOutputStream class
- Java FilterReader class
- Java FilterWriter class
- Java Flushable interface
- Java InputStream class
- Java InputStreamReader class
- Java InterruptedIOException class
- Java InvalidClassException class
- Java InvalidObjectException class
- Java IOError class
- Java IOException class
- Java LineNumberReader class
- Java NotActiveException class
- Java NotSerializableException class
- Java ObjectInput interface
- Java ObjectInputStream class
- Java ObjectInputValidation interface
- Java ObjectOutput interface
- Java ObjectOutputStream class
- Java ObjectStreamClass class
- Java ObjectStreamConstants interface
- Java ObjectStreamException class
- Java ObjectStreamField class
- Java OutputStream class
- Java OutputStreamWriter class
- Java PipedInputStream class
- Java PipedOutputStream class
- Java PipedReader class
- Java PipedWriter class
- Java PrintStream class
- Java PrintWriter class
- Java PushbackInputStream class
- Java PushbackReader class
- Java RandomAccessFile class
- Java Reader class
- Java SequenceInputStream class
- Java Serializable interface
- Java StreamCorruptedException class
- Java StreamTokenizer class
- Java StringReader class
- Java StringWriter class
- Java SyncFailedException class
- Java UncheckedIOException class
- Java Writer class
- Java ObjectInputValidation interface
- Java InvalidObjectException class
- Java ObjectInputValidation interface
Java Regex API
- Java Pattern class
- Java Matcher class
- Java MatchResult interface
- Java PatternSyntaxException class
- Java Pattern.compile method
- Java Pattern.matcher method
- Java Pattern.matches method
- Java Pattern.split method
- Java Pattern.pattern method
- Java Pattern.flags method
- Java Pattern.quote method
- Java Pattern.asPredicate method
- Java Pattern.splitAsStream method
- Java Matcher.matches method
- Java Matcher.lookingAt method
- Java Matcher.find method
- Java Matcher.start method
- Java Matcher.end method
- Java Matcher.group method
- Java Matcher.groupCount method
- Java Matcher.replaceAll method
- Java Matcher.replaceFirst method
- Java Matcher.appendReplacement method
- Java Matcher.appendTail method
- Java Matcher.reset method
- Java Matcher.region method
- Java Matcher.regionStart method
- Java Matcher.regionEnd method
- Java Matcher.hasTransparentBounds method
- Java Matcher.useTransparentBounds method
- Java Matcher.hasAnchoringBounds method
- Java Matcher.useAnchoringBounds method
- Java Matcher.toMatchResult method
- Java Matcher.results method
- Java MatchResult.start method
- Java MatchResult.end method
- Java MatchResult.group method
- Java MatchResult.groupCount method
- Java String.matches method
- Java String.split method
- Java String.replaceAll method
- Java String.replaceFirst method
- Java Pattern.asMatchPredicate method
- Java Matcher.replaceFirst method
Java DateTime API
- Java Instant class
- Java LocalDate class
- Java LocalTime class
- Java LocalDateTime class
- Java ZonedDateTime class
- Java OffsetDateTime class
- Java OffsetTime class
- Java ZoneId class
- Java ZoneOffset class
- Java Duration class
- Java Period class
- Java Clock class
- Java DayOfWeek enum
- Java Month enum
- Java Year class
- Java YearMonth class
- Java MonthDay class
- Java DateTimeFormatter class
- Java DateTimeFormatterBuilder class
- Java DecimalStyle class
- Java FormatStyle enum
- Java ResolverStyle enum
- Java SignStyle enum
- Java TextStyle enum
- Java Chronology interface
- Java ChronoLocalDate interface
- Java ChronoLocalDateTime interface
- Java ChronoZonedDateTime interface
- Java ChronoPeriod interface
- Java AbstractChronology class
- Java HijrahChronology class
- Java HijrahDate class
- Java JapaneseChronology class
- Java JapaneseDate class
- Java JapaneseEra class
- Java MinguoChronology class
- Java MinguoDate class
- Java ThaiBuddhistChronology class
- Java ThaiBuddhistDate class
- Java IsoChronology class
- Java DateTimeParseException class
- Java Temporal interface
- Java TemporalAccessor interface
- Java TemporalAdjuster interface
- Java TemporalAmount interface
- Java TemporalField interface
- Java TemporalQuery interface
- Java TemporalUnit interface
- Java ValueRange class
- Java WeekFields class
- Java ChronoField enum
- Java ChronoUnit enum
- Java IsoFields class
- Java JulianFields class
- Java ZoneRules class
- Java ZoneRulesProvider class
- Java ZoneOffsetTransition class
- Java ZoneOffsetTransitionRule class
- Java ZoneOffsetTransitionRule.TimeDefinition enum
- Java DateTimeException class
- Java ZoneRulesException class
Java Collections functions
- Java Collections.addAll method
- Java Collections.binarySearch method
- Java Collections.checkedCollection method
- Java Collections.checkedList method
- Java Collections.checkedMap method
- Java Collections.checkedSet method
- Java Collections.checkedSortedMap method
- Java Collections.checkedSortedSet method
- Java Collections.copy method
- Java Collections.disjoint method
- Java Collections.emptyList method
- Java Collections.emptyMap method
- Java Collections.emptySet method
- Java Collections.fill method
- Java Collections.frequency method
- Java Collections.max method
- Java Collections.min method
- Java Collections.nCopies method
- Java Collections.replaceAll method
- Java Collections.reverse method
- Java Collections.rotate method
- Java Collections.shuffle method
- Java Collections.singleton method
- Java Collections.singletonList method
- Java Collections.singletonMap method
- Java Collections.sort method
- Java Collections.swap method
- Java Collections.synchronizedCollection method
- Java Collections.synchronizedList method
- Java Collections.synchronizedMap method
- Java Collections.synchronizedSet method
- Java Collections.synchronizedSortedMap method
- Java Collections.synchronizedSortedSet method
- Java Collections.unmodifiableCollection method
- Java Collections.unmodifiableList method
- Java Collections.unmodifiableMap method
- Java Collections.unmodifiableSet method
- Java Collections.unmodifiableSortedMap method
- Java Collections.unmodifiableSortedSet method
Java Functional API
- Java Function interface
- Java BiFunction interface
- Java UnaryOperator interface
- Java BinaryOperator interface
- Java Predicate interface
- Java BiPredicate interface
- Java Consumer interface
- Java BiConsumer interface
- Java Supplier interface
- Java IntFunction interface
- Java IntPredicate interface
- Java IntConsumer interface
- Java IntSupplier interface
- Java IntUnaryOperator interface
- Java IntBinaryOperator interface
- Java ToIntFunction interface
- Java ToIntBiFunction interface
- Java LongFunction interface
- Java LongPredicate interface
- Java LongConsumer interface
- Java LongSupplier interface
- Java LongUnaryOperator interface
- Java LongBinaryOperator interface
- Java ToLongFunction interface
- Java ToLongBiFunction interface
- Java DoubleFunction interface
- Java DoublePredicate interface
- Java DoubleConsumer interface
- Java DoubleSupplier interface
- Java DoubleUnaryOperator interface
- Java DoubleBinaryOperator interface
- Java ToDoubleFunction interface
- Java ToDoubleBiFunction interface
- Java ObjIntConsumer interface
- Java ObjLongConsumer interface
- Java ObjDoubleConsumer interface
- Java BooleanSupplier interface
- Java Predicate interface
- Java Function.identity method
- Java Function.compose method
- Java Function.andThen method
last modified November 25, 2026