🆕 Free Interactive Selenium, Playwright & API tools — no signup — Start Free Automation Roadmap →
📁
All Topics › Java for Testing

Java for Testing

Java for test automation: basics, OOP, keywords, strings, collections, exceptions and programs.

45 Articles
22 Beginner
18 Intermediate
5 Advanced
Beginner 📅 Oct 16, 2026 👁 17 views

How to Install Java JDK on Windows, Mac and Linux (2026 Guide for Testers)

Install Java JDK 21 on Windows, macOS or Linux, set JAVA_HOME and PATH correctly, verify with java and javac, and fix the errors testers hit most often.

Beginner 📅 Oct 5, 2026 👁 51 views

static and final Keywords in Java: Variables, Methods, Blocks and Classes

The static and final keywords in Java: static variables, methods, blocks and nested classes; final variables, references, methods and classes, with examples.

Beginner 📅 Oct 5, 2026 👁 34 views

Strings in Java: String Pool, Immutability, StringBuilder and All String Methods

How Java strings work: the string pool, why String is immutable, == vs equals, String vs StringBuilder vs StringBuffer, and every common String method.

Intermediate 📅 Oct 5, 2026 👁 22 views

Java Queue, Deque and PriorityQueue + Iterators, Collections Utilities and Special Maps

Java Queue, Deque and PriorityQueue with examples, fail-fast vs fail-safe iterators, the Collections utility class and special maps.

Intermediate 📅 Oct 5, 2026 👁 30 views

Multithreading in Java: Creating Threads, Thread Lifecycle, synchronized and volatile

Multithreading in Java with examples: three ways to create threads, the thread lifecycle, race conditions, synchronized, volatile and AtomicInteger.

Advanced 📅 Oct 5, 2026 👁 28 views

Java Concurrency: ExecutorService, CompletableFuture, Fork/Join, Locks and Virtual Threads

Java concurrency beyond raw threads: ExecutorService and thread pools, CompletableFuture, Fork/Join, CountDownLatch, read-write locks.

Intermediate 📅 Oct 5, 2026 👁 41 views

Java Generics: Generic Classes, Methods, Wildcards and Type Erasure

Java generics with examples: generic classes and methods, bounded types, wildcards (? extends, ? super, PECS) and type erasure, with interview questions.

Intermediate 📅 Oct 5, 2026 👁 20 views

Java Lambda Expressions, Functional Interfaces, Method References and Optional

Java lambda expressions explained: syntax, functional interfaces (Function, Predicate, Consumer, Supplier), method references, how lambdas work, and Optional.

Intermediate 📅 Oct 5, 2026 👁 42 views

Java Streams API: filter, map, collect, Collectors and Parallel Streams

Java Streams API with examples: building a pipeline, intermediate and terminal operations, Collectors (groupingBy, joining), primitive streams.

Advanced 📅 Oct 5, 2026 👁 31 views

Java Serialization, Reflection API and Custom Annotations

Java serialization and serialVersionUID, the Reflection API for inspecting classes at run time, and writing custom annotations, with interview questions.

Beginner 📅 Oct 5, 2026 👁 24 views

Java Enums and Inner Classes: Types, Examples and When to Use Them

Java enums with fields, methods and switch, plus the four kinds of nested classes: inner, static nested, local and anonymous, with practical examples.

Advanced 📅 Oct 5, 2026 👁 25 views

Design Patterns in Java (Part 1): Singleton, Decorator, Proxy, Facade, Adapter, Flyweight and Composite

Creational and structural design patterns in Java with code: Singleton and its pitfalls, Decorator, Proxy, Facade, Adapter, State, Flyweight and Composite.

Advanced 📅 Oct 5, 2026 👁 26 views

Design Patterns in Java (Part 2): Strategy, Command, Template Method, Chain of Responsibility and More

Behavioral design patterns in Java with code: Strategy, Command, Template Method, Chain of Responsibility, Mediator, Memento, Visitor.

Advanced 📅 Oct 5, 2026 👁 30 views

JVM Memory Model, Garbage Collection, JVM Tuning and ClassLoaders

How the JVM manages memory: heap, stack, metaspace, generations, garbage collectors (G1, ZGC, Parallel), JVM tuning flags and the ClassLoader hierarchy.

Intermediate 📅 Oct 5, 2026 👁 33 views

Java 8 to Java 21 Features: Lambdas, var, Records, Sealed Classes, Pattern Matching and Modules

What changed from Java 8 to Java 21: lambdas and streams, modules, var, text blocks, records, pattern matching, sealed classes.

Intermediate 📅 Oct 5, 2026 👁 32 views

Mockito Tutorial: Mocks, Stubbing, Verification, Spies and Argument Captors

Mockito tutorial with JUnit 5: @Mock and @InjectMocks, stubbing with when/thenReturn, verify, argument matchers, ArgumentCaptor, spies and common mistakes.

Intermediate 📅 Oct 5, 2026 👁 38 views

AssertJ Tutorial: Fluent Assertions for Strings, Collections, Objects and Exceptions

AssertJ fluent assertions with examples: strings, numbers, collections, objects, exceptions, soft assertions and custom messages, for JUnit and TestNG.

Intermediate 📅 Oct 5, 2026 👁 28 views

Java Best Practices: Clean Code, SOLID, Effective Java, Immutability and Anti-Patterns

Java best practices with examples: naming and function design, SOLID, logging, Effective Java rules, immutable objects.

Beginner 📅 Oct 5, 2026 👁 30 views

Java Date and Time API (java.time): LocalDate, LocalDateTime, ZonedDateTime, Duration and Formatting

The java.time API with examples: LocalDate, LocalDateTime, ZonedDateTime, Instant, Duration and Period, formatting and parsing, and time zones in tests.

Intermediate 📅 Oct 5, 2026 👁 33 views

Regular Expressions in Java: Pattern, Matcher, Groups and Common Regex Examples

Regular expressions in Java: Pattern and Matcher, character classes, quantifiers, groups, lookarounds, replaceAll and split.

Intermediate 📅 Oct 5, 2026 👁 29 views

Java File I/O: Writing Files, Byte and Character Streams, and NIO.2

Java file I/O explained: writing files, InputStream/OutputStream and Reader/Writer hierarchies, buffering, java.nio Files and Path.

Beginner 📅 Oct 5, 2026 👁 46 views

Java Certifications Guide (2026): Oracle Java SE 17 and 21, Plus Certifications for SDETs

Which Java certification to take: Oracle Java SE 21 and 17 Developer (OCP), Java Foundations, and certifications useful for SDETs.

Intermediate 📅 Oct 5, 2026 👁 36 views

Java HttpClient (Java 11+): GET, POST, Headers, Async Requests and Sockets

Java 11+ HttpClient with examples: GET and POST requests, headers, timeouts, async calls, reading JSON, and basic sockets.

Intermediate 📅 Oct 5, 2026 👁 32 views

Java Object Class Methods: equals, hashCode, toString, getClass, clone, wait and notify

The methods every Java class inherits from Object: equals and hashCode (and their contract), toString, getClass, clone, finalize, wait, notify and notifyAll.

Beginner 📅 Oct 5, 2026 👁 33 views

OOPs Concepts in Java: Encapsulation, Inheritance, Polymorphism and Abstraction

The four OOPs concepts in Java explained with code: encapsulation, inheritance, polymorphism (overloading vs overriding) and abstraction.

Beginner 📅 Oct 5, 2026 👁 95 views

What Is Java? History, Key Features and Why Testers Use It

What Java is and how it works: history from Sun to Oracle, bytecode and the JVM, the key features of Java explained, where it is used, and why testers learn it.

Beginner 📅 Oct 5, 2026 👁 34 views

Java Operators and Expressions: Types, Precedence and Common Traps

Java operators with examples: arithmetic, relational, logical, assignment, ternary and instanceof, the precedence table, and traps like == and integer division.

Beginner 📅 Oct 5, 2026 👁 42 views

Control Flow Statements in Java: if, switch, Loops, break and continue

Java control flow statements with examples: if-else, switch and switch expressions, for, for-each, while, do-while, break, continue and labeled loops.

Beginner 📅 Oct 5, 2026 👁 36 views

Classes and Objects in Java: Fields, Constructors, Methods and Records

Classes and objects in Java explained: fields, methods, constructors, references, static vs instance, this, a page object example, and records for test data.

Intermediate 📅 Oct 5, 2026 👁 26 views

Exception Handling in Java: try-catch-finally, Checked vs Unchecked, Stack Traces

Exception handling in Java: hierarchy, try-catch-finally, try-with-resources, checked vs unchecked, throw vs throws, stack traces and custom exceptions.

Intermediate 📅 Oct 5, 2026 👁 22 views

Assertions in Java: the assert Keyword vs TestNG, JUnit and AssertJ

Java assertions: the assert keyword, enabling it with -ea, when not to use it, and how it differs from TestNG, JUnit and AssertJ assertions, hard and soft.

Intermediate 📅 Oct 5, 2026 👁 27 views

JAR Files in Java: Create, Run and Build Executable JARs (with Maven)

What JAR files are and how to use them: create with the jar tool, the manifest and Main-Class, java -jar vs -cp, fat JARs with Maven, and JARs testers run.

Beginner 📅 Oct 5, 2026 👁 42 views

How to Read a File in Java: Scanner, Files and BufferedReader

Read files in Java with Scanner, Files.readString, readAllLines, Files.lines and BufferedReader, load CSV test data for TestNG, and fix path and encoding bugs.

Beginner 📅 Oct 4, 2026 👁 34 views

Java SE vs Java EE (Jakarta EE) vs Java ME: Differences Explained

Java SE vs Java EE (now Jakarta EE) vs Java ME: what each edition contains, the javax to jakarta change, which one testers need, and a quick comparison table.

Beginner 📅 Oct 4, 2026 👁 46 views

Java Keywords: Complete List of All 51 Reserved Keywords (with Examples)

Complete list of Java keywords: all 51 reserved keywords with meanings, contextual keywords like var and record, examples, common mistakes and FAQs.

Beginner 📅 Oct 4, 2026 👁 42 views

Hello World in Java: Your First Program and the Structure of a Java Program

Write and run your first Java Hello World program, understand every part of a Java program's structure, and fix the 4 errors beginners hit most.

Beginner 📅 Oct 4, 2026 👁 30 views

Primitive Data Types in Java: Sizes, Ranges, Defaults and Common Traps

All 8 primitive data types in Java with size, range and default value, verified with real Java output, plus overflow, integer division and float traps.

Beginner 📅 Jul 15, 2026 👁 113 views

Count Vowels and Consonants in Java | Step-by-Step Guide with Code Examples

Learn how to count vowels and consonants in Java strings. Includes multiple methods, code examples, and handles uppercase, lowercase, and special characters.

Intermediate 📅 Jul 9, 2026 👁 110 views

JDBC and Database Connectivity in Java: Steps & Examples

Learn JDBC in Java — what it is, what a JDBC driver does, and the standard steps to connect a Java application to a database, with a full code example.

Beginner 📅 Jul 9, 2026 👁 105 views

Java Strings, Encoding (UTF-8), Wrapper Classes and Exception Handling

Java strings and immutability, string encoding and charsets (UTF-8 vs ISO-8859-1), StringBuilder, wrapper classes and exception handling — with examples.

Intermediate 📅 Jul 9, 2026 👁 100 views

Java Collections: Set, HashMap, ArrayList vs LinkedList & Thread-Safe Maps

Learn Java collections — the Set interface, HashMap internals, ArrayList vs LinkedList, synchronized maps vs ConcurrentHashMap, and forEach vs Iterator.

Beginner 📅 Jul 9, 2026 👁 89 views

Interfaces in Java: Comparable, Default Methods, Nested & Final

Interfaces in Java: Comparable and Comparator (and the compareTo overflow bug), Java 8 default methods, why interfaces can't be instantiated or final.

Beginner 📅 Jul 9, 2026 👁 104 views

Java Access Modifiers and super Keyword: OOP Keywords Explained with Examples

Java access modifiers (private, default, protected, public) and the super keyword, with a comparison table, overriding rules and Selenium examples.

Beginner 📅 Jul 9, 2026 👁 163 views

How Java Code Runs: Compilation Process, JVM and Platform Independence

The Java compilation process step by step: javac turns .java into bytecode, the class loader and JVM verify and run it, and the JIT compiler makes it fast.

Beginner 📅 Jul 9, 2026 👁 144 views

Java Basics: Variables, Objects, Data Types and Loops (With Examples)

Java basics for testers: instance, static and local variables, creating objects, primitive vs non-primitive data types, and while vs do-while loops.