Java ट्यूटोरियल
Learn Java from your first program to collections, streams, concurrency, networking and the JVM. real Java 25 running in your browser, quizzes and projects.
Getting Started
- Java के साथ शुरुआत Learn what Java is, where it runs today and how to write your first Java 25 program, in both the short modern form and the classic public class Main style.
- Java कैसे काम करता है: JDK, JVM और बाइटकोड Follow a Java program from source code to bytecode to the JVM. Learn what the JDK, JRE and JIT compiler are, which LTS version to install and how to run Java files.
- Java सिंटैक्स Learn the basic rules of Java syntax - statements and semicolons, blocks and braces, classes and methods, case sensitivity, naming conventions and reading compiler errors.
- कमेंट और Javadoc (Comments and Javadoc) Learn Java's comment styles - // and /* */, Javadoc with @param and @return, Markdown doc comments with /// (Java 23+) - and the habits that make comments useful.
- आउटपुट प्रिंट करना Print output in Java with System.out.println, print and IO.println, use escape sequences like \n and \t, format numbers with printf, and send errors to System.err.
- यूज़र इनपुट पढ़ना Read keyboard input in Java with Scanner, IO.readln (Java 25) and BufferedReader. Parse numbers safely, avoid the nextInt + nextLine trap and loop over all input.
- Java कीवर्ड और आइडेंटिफ़ायर See every reserved Java keyword grouped by purpose, the contextual keywords like var, record, sealed and yield, the literals true, false and null, and the rules for identifiers.
- JShell: Java का REPL Learn JShell, Java's built-in REPL. Type expressions, declare variables and methods, use commands like /vars and /list, and drive JShell from your own code.
Variables and Types
- वेरिएबल (Variables) Learn how Java variables work - declaring them with a type, initializing and reassigning values, naming them well, definite assignment rules and a first look at scope.
- प्रिमिटिव डेटा टाइप Learn Java's eight primitive types, their sizes, ranges and default values, how to write int, long, float and hex or binary literals, and how primitives differ from references.
- नंबरों के साथ काम करना Understand how Java numbers really behave - integer division and remainder, silent overflow and Math.addExact, floating-point precision, NaN, Infinity and when to use BigDecimal.
- कैरेक्टर और बूलियन (Characters and Booleans) Learn how Java's char stores UTF-16 code units, do arithmetic with characters, use Character methods, handle emoji and code points, and write clear boolean expressions.
- टाइप कास्टिंग और कन्वर्ज़न Learn Java type casting - automatic widening, narrowing casts and data loss, rounding vs truncating, converting int to String and back, and handling NumberFormatException.
- var के साथ लोकल वेरिएबल टाइप इन्फ़रेंस Learn how Java's var keyword infers local variable types, where it is allowed and forbidden, what type it really picks, and when var makes code clearer or harder to read.
- कॉन्स्टेंट और final Learn to create constants in Java with final and static final, name them in UPPER_SNAKE_CASE, avoid magic numbers, and understand effectively final variables and lambdas.
- Math क्लास Master Java's Math class - abs, pow, sqrt, hypot, max and min, round vs floor vs ceil, clamp, floorDiv and floorMod, trigonometry, and Math.random vs Random vs RandomGenerator.
Operators
- अंकगणितीय ऑपरेटर Learn Java's arithmetic operators, unary minus, string concatenation with +, integer vs floating-point division, operator precedence and the numeric promotion rules behind every result.
- असाइनमेंट और इंक्रीमेंट ऑपरेटर Learn Java's = and compound assignment operators, the hidden cast inside +=, prefix vs postfix ++ and --, and the classic puzzles that trip up developers.
- तुलना और लॉजिकल ऑपरेटर (Comparison and Logical Operators) Compare values in Java with ==, !=, <, >, <= and >=, combine conditions with &&, || and !, understand short-circuiting, and see why objects need equals().
- बिटवाइज़ और शिफ़्ट ऑपरेटर Learn Java's bitwise operators & | ^ ~ and the shifts << >> >>>, how two's complement works, and how to use flags, masks and Integer bit helpers.
- ऑपरेटर प्रेसिडेंस और टर्नरी ऑपरेटर See Java's full operator precedence table, how associativity and left-to-right evaluation work, and how to use the ?: ternary operator and instanceof safely.
Strings
- स्ट्रिंग Learn how Java strings work, from literals, length and charAt to immutability, equals vs ==, the string pool, intern, compareTo, isEmpty and isBlank.
- स्ट्रिंग मेथड A practical tour of Java String methods - substring, indexOf, contains, replace vs replaceAll, split, join, strip, repeat, chars and lines - with their pitfalls.
- स्ट्रिंग फ़ॉर्मैटिंग Format text in Java with String.format, formatted() and printf - width, flags, precision, argument indexes, dates - plus NumberFormat and Locale for any country.
- टेक्स्ट ब्लॉक और Escape सीक्वेंस Write multi-line strings with Java text blocks - indentation rules, the closing delimiter, \ and \s escapes - plus every escape sequence and JSON, SQL and HTML examples.
- StringBuilder Learn Java's StringBuilder - why += in a loop is slow, how append, insert, delete, replace and reverse work, capacity, chaining and the pitfalls to avoid.
- StringBuffer, StringJoiner और StringTokenizer Compare StringBuffer and StringBuilder, join text with StringJoiner, String.join and Collectors.joining, and replace legacy StringTokenizer with split.
- स्ट्रिंग की तुलना और रूपांतरण Compare Java strings with equals, equalsIgnoreCase, compareTo and Collator, and convert between strings, numbers, char arrays and byte arrays safely.
Control Flow
- if, else if और else Make decisions in Java with if, else if and else - boolean conditions, nesting, guard clauses, brace style and classic bugs like = vs == and the dangling else.
- switch स्टेटमेंट और एक्सप्रेशन Master Java switch - classic case and break, fall-through, arrow labels, switch expressions with yield, strings, enums, null handling and exhaustiveness.
- while और do-while लूप Repeat code in Java with while and do-while loops - counters, sentinel values, input loops, infinite loops with break, and the bugs that make loops never stop.
- for लूप Learn Java for loops - the classic counting loop, for-each over arrays and lists, nested loops, multiple loop variables, loop variable scope and off-by-one bugs.
- break, continue और लेबल (Labels) Control Java loops with break and continue, exit nested loops with labeled break, skip with labeled continue, return from loops, and avoid the classic traps.
Arrays
- ऐरे (Arrays) Learn Java arrays - declaring and creating them, indexes and length, default values, array literals, ArrayIndexOutOfBoundsException and why arrays are objects.
- ऐरे में लूप चलाना Loop through Java arrays with for and for-each - sum, max, min and average, searching, counting, reversing in place, modifying elements and copying arrays safely.
- बहु-आयामी ऐरे Learn Java multidimensional arrays - creating 2D arrays, rows and columns, jagged arrays, nested loops over grids, printing with deepToString and matrix multiplication.
- Arrays क्लास Master java.util.Arrays - toString, sort with comparators, binarySearch, fill, setAll, copyOf, equals and deepEquals, asList pitfalls, stream, mismatch and compare.
Methods
- मेथड Learn Java methods - why they matter, how to define and call them, static methods, void methods, return in brief, naming conventions and how to split a program into methods.
- पैरामीटर और रिटर्न वैल्यू Pass data into Java methods and get results back - parameters vs arguments, return rules, why Java is always pass-by-value, and returning several values with records.
- मेथड ओवरलोडिंग Learn Java method overloading - the rules, how the compiler picks an overload through widening, boxing and varargs, ambiguous calls, and the list.remove(int) trap.
- वेरिएबल स्कोप Understand Java variable scope - block and method scope, loop variables, fields vs local variables, shadowing with this, pattern variable scope and how long variables live.
- रिकर्शन (Recursion) Learn recursion in Java - base cases, how the call stack works, factorial, Fibonacci, power and sums, StackOverflowError, recursion vs loops and memoization.
- वेरिएबल आर्ग्युमेंट (Varargs) Learn Java varargs - the Type... syntax, how arguments become an array, the rules, null and empty calls, overloading pitfalls, and how String.format and List.of use them.
- main मेथड और कमांड-लाइन आर्ग्युमेंट Understand every word of public static void main(String[] args), Java 25 instance main methods, reading and parsing command-line arguments, and exit codes with System.exit.
- Static बनाम इंस्टेंस मेथड Learn the difference between static and instance methods in Java, the calling rules, the "non-static method cannot be referenced" error, utility classes and how to choose.
Object-Oriented Programming
- ऑब्जेक्ट-ओरिएंटेड प्रोग्रामिंग Learn what object-oriented programming means in Java - classes vs objects, state and behavior, encapsulation, inheritance, polymorphism, abstraction and how OOP compares to procedural code.
- क्लास और ऑब्जेक्ट (Classes and Objects) Learn to define Java classes, create objects with new, understand references and aliasing, null and NullPointerException, several classes in one file and objects in memory.
- फ़ील्ड और इंस्टेंस मेथड Learn Java instance fields, their default values and initializers, instance methods that read and change object state, accessing members, and when to use fields vs local variables.
- कंस्ट्रक्टर Learn Java constructors - default and parameterized constructors, overloading, this(...) chaining, validating arguments, initialization order, Java 25 flexible bodies and copy constructors.
- this कीवर्ड Learn what this means in Java - telling fields from parameters, the self-assignment bug, passing this to other objects, fluent APIs, this(...) and lambdas.
- एक्सेस मॉडिफ़ायर Learn Java's access modifiers - public, protected, package-private and private - with a clear table, class-level privacy, private constructors and practical rules.
- एनकैप्सुलेशन, Getter और Setter Learn encapsulation in Java - private fields, getters and setters done right, protecting invariants, hiding the representation and making defensive copies.
- इम्यूटेबल क्लास Learn how to write immutable classes in Java - final fields, no setters, defensive copies, with-methods - why they're safer for maps and threads, and records.
- Static फ़ील्ड, मेथड और ब्लॉक Learn Java static members - shared fields and counters, static methods, utility classes, static and instance initializer blocks, and the exact initialization order.
- इनहेरिटेंस Learn Java inheritance - extends and is-a, what subclasses inherit, constructor chaining, protected, single inheritance, final classes and Object as the root.
- super कीवर्ड Learn Java's super keyword - calling parent constructors, extending overridden methods, reaching hidden fields, constructor order and the Java 25 prologue.
- पॉलिमॉर्फ़िज़्म और मेथड ओवरराइडिंग Learn Java polymorphism - method overriding with @Override, dynamic dispatch, overriding rules, overloading vs overriding, upcasting, downcasting and instanceof.
- एब्स्ट्रैक्शन और एब्स्ट्रैक्ट क्लास Learn abstraction in Java - abstract classes and methods, the rules the compiler enforces, constructors in abstract classes and the template method pattern.
- इंटरफ़ेस Learn Java interfaces - implementing one or many, default, static and private methods, constants, marker interfaces, and when to pick an interface over an abstract class.
- कम्पोज़िशन, एग्रीगेशन और एसोसिएशन Learn has-a relationships in Java - association, aggregation and composition, why to favor composition over inheritance, and how delegation keeps classes flexible.
- रिकॉर्ड (Records) Learn Java records - what the compiler generates, compact constructors for validation, shallow immutability, static factories, local records and when to use them.
- Enum Learn Java enums - named constants, values() and valueOf, fields and constructors, constant-specific methods, switch expressions, EnumSet and EnumMap.
- नेस्टेड, इनर, लोकल और अनाम क्लास Learn the four kinds of Java nested classes - static nested, inner, local and anonymous - how they access outer members, when to use each, and the memory pitfall.
- Object क्लास: equals, hashCode और toString Learn the Object class in Java - overriding equals and hashCode correctly, the contract between them, useful toString, getClass, and the Objects helper methods.
- ऑब्जेक्ट की कॉपी बनाना: क्लोनिंग और कॉपी कंस्ट्रक्टर Learn how to copy objects in Java - reference copies, shallow vs deep copies, Cloneable and clone() pitfalls, copying arrays, and why copy constructors are preferred.
- Sealed क्लास और इंटरफ़ेस Learn Java sealed classes and interfaces - sealed, permits, final and non-sealed subclasses, records as subtypes, exhaustive switches and modeling closed hierarchies.
- पैटर्न मैचिंग Learn Java pattern matching - instanceof patterns, switch with type patterns, case null, guards with when, nested record patterns, exhaustive sealed switches and unnamed _.
- हर जगह final कीवर्ड Learn every use of Java final - local variables, parameters, fields, methods and classes, blank finals, effectively final, illegal combinations and final vs immutable.
- पैकेज और इम्पोर्ट Learn Java packages and imports - package names and folders, single-type and on-demand imports, name clashes, static import, import module (Java 25) and the classpath.
- JavaBeans और प्रॉपर्टी चेंज इवेंट Learn the JavaBeans conventions, bound and constrained properties with PropertyChangeSupport and VetoableChangeSupport, and how Introspector finds properties.
Exceptions
- Exceptions और try-catch Learn Java exceptions - how they propagate, reading stack traces, try-catch-finally, multiple catch blocks, multi-catch, errors vs exceptions and the common built-in exceptions.
- एक्सेप्शन फेंकना: throw और throws Learn to throw exceptions in Java - the throw statement, the throws clause, checked vs unchecked exceptions, the Throwable hierarchy, choosing exception types and rethrowing.
- कस्टम एक्सेप्शन Learn to create custom exceptions in Java - checked or unchecked, the standard constructors, extra fields, exception hierarchies, chaining causes and exception translation.
- try-with-resources Learn Java try-with-resources - AutoCloseable and Closeable, closing order, multiple resources, suppressed exceptions, failures while opening and writing your own resources.
- एक्सेप्शन हैंडलिंग की बेस्ट प्रैक्टिस Handle Java exceptions like a professional - never swallow them, catch specific types, fail fast, avoid finally traps, choose Optional or exceptions, log once.
- Java प्रोग्राम डिबग करना Learn to debug Java - read stack traces and Caused by chains, use helpful NullPointerException messages, print debugging, assertions, debuggers and common bugs.
- स्टैक ट्रेस और एक्सेप्शन चेनिंग Read Java stack traces line by line, chain exceptions with a cause, handle suppressed exceptions, use StackWalker and learn what each Caused by and "... n more" line really means.
Collections
- रैपर क्लास और ऑटोबॉक्सिंग Learn Java wrapper classes - Integer, Double, Boolean and friends, autoboxing and unboxing, valueOf vs parseInt, the Integer cache, == pitfalls and null NPEs.
- कलेक्शन फ़्रेमवर्क (The Collections Framework) A map of the Java Collections Framework - Collection, List, Set, Queue, Deque, Map and sequenced collections, the main implementations and how to choose one.
- ArrayList Master Java ArrayList - add, get, set and remove, searching, safe removal while iterating, removeIf, subList views, sorting, capacity growth and performance.
- LinkedList Learn Java LinkedList - List and Deque methods, how its doubly linked nodes work, the get(i) trap, when it really helps, and an ArrayList vs LinkedList benchmark.
- HashMap Learn Java HashMap - put, get, getOrDefault and putIfAbsent, iterating entries, merge, compute and computeIfAbsent, plus counting and grouping recipes.
- HashMap अंदर से कैसे काम करता है See how Java HashMap works inside - hash codes, buckets, collisions, load factor and resizing, treeified bins, why mutable keys break maps and what makes a good hashCode.
- HashSet Learn Java HashSet - storing unique values, add/contains/remove, union, intersection and difference, iteration order, and why equals and hashCode matter.
- LinkedHashMap और LinkedHashSet Learn Java LinkedHashMap and LinkedHashSet - predictable insertion order, access order, an LRU cache with removeEldestEntry, and the Java 21 sequenced methods.
- TreeMap और TreeSet Learn Java TreeMap and TreeSet - sorted keys, first/last, floor/ceiling/higher/lower, headMap, tailMap and subMap ranges, NavigableMap and custom comparators.
- इटरेटर और ListIterator Learn Java iterators - hasNext, next and remove, ListIterator for both directions, why ConcurrentModificationException happens, and how to implement Iterable.
- क्यू, डेक और PriorityQueue Learn Java queues - offer, poll and peek, ArrayDeque as a stack and a queue, PriorityQueue with comparators, top-k problems, and the mistakes to avoid.
- Comparable और Comparator से सॉर्टिंग Learn to sort in Java - the compareTo contract, Comparable natural order, Comparator.comparing, thenComparing, reversed, nullsFirst, List.sort and stable sorting.
- इम्म्यूटेबल कलेक्शन और यूटिलिटी मेथड Learn Java immutable collections - List.of, Set.of, Map.of, copyOf, unmodifiable views, the Collections helper methods and Java 21 sequenced getFirst, getLast and reversed.
- AbstractList और AbstractMap से कस्टम कलेक्शन बनाना Build your own Java collections the easy way. Extend AbstractList, AbstractSequentialList and AbstractMap, implement a few methods, and inherit the rest of the List and Map API.
- EnumMap, EnumSet, IdentityHashMap, WeakHashMap और BitSet Learn the specialized Java collections - EnumMap and EnumSet for enum keys, IdentityHashMap for reference equality, WeakHashMap for GC-friendly maps and BitSet for flags.
- लेगेसी कलेक्शन: Vector, Stack, Hashtable और Enumeration Learn what Java's legacy collections Vector, Stack, Hashtable and Enumeration do, why they are outdated, and which modern classes replace them in new code.
- सही कलेक्शन चुनना (Choosing the Right Collection) Pick the right Java collection every time with a step-by-step decision guide, a Big-O table for common operations, memory notes and simple timing with System.nanoTime.
Generics and Functional Programming
- जेनेरिक (Generics) Learn Java generics - why they exist, writing generic classes, interfaces and methods, type inference and the diamond operator, invariance, and why raw types are unsafe.
- बाउंडेड टाइप और वाइल्डकार्ड Learn Java bounded type parameters and wildcards - T extends, multiple bounds, ? extends and ? super, the PECS rule, unbounded ?, and when to use a wildcard or a type parameter.
- टाइप इरेज़र और जेनेरिक की सीमाएँ Learn how Java type erasure works, why new T(), generic arrays, primitives and instanceof List<String> aren't allowed, the workarounds, heap pollution and @SafeVarargs.
- लैम्ब्डा एक्सप्रेशन Learn Java lambda expressions - syntax forms, target typing, capturing effectively final variables, this in lambdas, and using lambdas with forEach, removeIf, sort and replaceAll.
- Functional Interface Learn Java functional interfaces - Function, Predicate, Consumer, Supplier, BiFunction, operators, primitive versions, composing with andThen and negate, and @FunctionalInterface.
- मेथड रेफ़रेंस Learn Java method references - static, bound and unbound instance, and constructor references, how they map to lambdas, when receivers are evaluated, and when a lambda reads better.
- स्ट्रीम (Streams) Learn Java streams - creating them, filter/map/sorted/distinct/limit/skip, terminal operations, laziness, short-circuiting and IntStream ranges, with runnable examples.
- स्ट्रीम के नतीजे इकट्ठा करना Learn Java stream collectors - toList, toSet, toMap with merge functions, groupingBy with downstream collectors, partitioningBy, joining, summarizing and reduce.
- एडवांस्ड स्ट्रीम Go beyond stream basics - flatMap and mapMulti, takeWhile/dropWhile, infinite streams, parallel streams and when to avoid them, Java 24 gatherers and common mistakes.
- Optional Learn Java Optional - creating it with of/empty/ofNullable, map, flatMap and filter, orElse vs orElseGet, orElseThrow, ifPresentOrElse and when not to use Optional.
- Java में फ़ंक्शनल प्रोग्रामिंग Learn functional programming in Java - pure functions, immutability, higher-order functions, currying and partial application, composition, laziness, and recursion vs streams.
Working with Data
- तारीख़ें और समय Learn the java.time API - LocalDate, LocalTime, LocalDateTime, ZonedDateTime, Instant, Duration, Period, TemporalAdjusters and DateTimeFormatter, plus why to avoid Date.
- रेगुलर एक्सप्रेशन Learn Java regular expressions - regex syntax, Pattern and Matcher, matches vs find, capturing and named groups, flags, replaceAll with functions, split and performance tips.
- BigInteger और BigDecimal Learn BigInteger for integers of any size and BigDecimal for exact decimal and money math - creating values, scale and precision, rounding modes, division and compareTo vs equals.
- रैंडम नंबर Generate random numbers in Java with Random, ThreadLocalRandom and RandomGenerator, make results repeatable with seeds, use SecureRandom for tokens, and shuffle and sample.
- UUID, हैशिंग और Base64 Create UUIDs in Java, hash data with MessageDigest and SHA-256, print bytes with HexFormat, encode with Base64, verify with HMAC and compute CRC32 checksums.
- लोकेल और इंटरनेशनलाइज़ेशन Format numbers, currencies, percentages and dates for any country with Java's Locale, load translations with ResourceBundle, and avoid the Turkish i and other locale bugs.
- टाइम ज़ोन और डेलाइट सेविंग Handle time zones in Java correctly - ZoneId vs ZoneOffset, ZonedDateTime, Instant, DST gaps and overlaps, and the mistakes that break scheduling code.
Input and Output
- फ़ाइलें पढ़ना और लिखना Read and write files in Java with Path and Files - writeString, readString, readAllLines, lines, append, copy, move, delete - plus error handling and safe, atomic writes.
- बाइट और कैरेक्टर स्ट्रीम Understand Java I/O streams - InputStream and OutputStream for bytes, Reader and Writer for text, buffering, PrintWriter, InputStreamReader and closing with try-with-resources.
- Reader और Writer क्लासें विस्तार से A tour of Java's character streams - the Reader and Writer methods, StringReader, CharArrayReader and Writer, FilterReader, InputStreamReader, PipedReader, FileReader and PrintWriter.
- डायरेक्टरी के साथ काम करना Work with folders in Java - create directories, list them with Files.list and DirectoryStream globs, walk and search trees, read file attributes, use temp folders and delete trees.
- सीरियलाइज़ेशन Learn Java serialization - Serializable, ObjectOutputStream and ObjectInputStream, transient fields, serialVersionUID, custom writeObject, records, filters and safer alternatives.
- कैरेक्टर सेट और एन्कोडिंग (Character Sets and Encoding) Understand bytes vs characters in Java - Unicode, UTF-8 and UTF-16, StandardCharsets, getBytes and new String, mojibake, BOMs, malformed input and the UTF-8 default.
- प्रॉपर्टीज़ फ़ाइलें और कॉन्फ़िगरेशन Learn Java configuration - load and store .properties files with java.util.Properties, defaults, system properties with -D, environment variables and Preferences.
- GZIP और ZIP से डेटा कंप्रेस करना Compress data in Java with GZIPOutputStream and GZIPInputStream, build and read ZIP archives, verify data with CRC32, and avoid zip slip and zip bombs.
- Java में इमेज प्रोसेसिंग Read and write images with ImageIO, get and set pixels in a BufferedImage, and build grayscale, negative, sepia, color-channel, random and mirror filters in plain Java.
- Scanner के पैटर्न और जाल Master Java's Scanner - token versus line reading, custom delimiters, the newline trap, hasNext loops, regex methods, locales and when to choose BufferedReader instead.
- NIO.2: Path, Files और WatchService Learn Java NIO.2 - Path operations like resolve and relativize, Files copy and move options, atomic moves, zip file systems and WatchService for reacting to folder changes.
- बाहरी प्रोसेस चलाना Learn how to run external programs from Java with ProcessBuilder - read output, feed input, merge stderr, check exit codes, set timeouts, environment variables and avoid deadlocks.
Concurrency
- थ्रेड (Threads) Learn Java threads - processes vs threads, creating threads with Thread and Runnable, start vs run, join, sleep, thread names, daemon threads and thread exceptions.
- थ्रेड लाइफ़साइकल और प्रायोरिटी Learn the Java thread lifecycle - NEW, RUNNABLE, BLOCKED, WAITING, TIMED_WAITING and TERMINATED with getState demos, thread priorities and how to interrupt threads.
- सिंक्रोनाइज़ेशन और रेस कंडीशन Understand race conditions in Java and fix them with synchronized methods and blocks, intrinsic locks, volatile and the happens-before rules, with runnable demos.
- थ्रेड के बीच संचार: wait और notify Learn how Java threads cooperate with wait, notify and notifyAll - the guarded-block pattern, a producer-consumer buffer, spurious wakeups and common mistakes.
- डेडलॉक, लाइवलॉक और स्टार्वेशन See a Java deadlock happen and time out safely with tryLock, detect deadlocks with ThreadMXBean, prevent them with lock ordering, and avoid livelock and starvation.
- Lock और Condition Learn the java.util.concurrent.locks API - ReentrantLock, tryLock with timeouts, lockInterruptibly, ReadWriteLock, Condition, StampedLock and when to prefer synchronized.
- एटॉमिक वेरिएबल Learn Java atomic variables - AtomicInteger, AtomicLong, AtomicReference and AtomicBoolean, compareAndSet loops, LongAdder, and when atomics beat locks.
- Executors और थ्रेड पूल Learn Java executors - ExecutorService, fixed, cached and scheduled thread pools, Callable and Future, invokeAll and invokeAny, and how to shut a pool down properly.
- CompletableFuture Learn Java CompletableFuture - supplyAsync, thenApply, thenCompose and thenCombine, allOf and anyOf, exceptionally and handle, and timeouts with orTimeout.
- CountDownLatch, CyclicBarrier, Semaphore और Phaser Learn Java synchronizers - CountDownLatch to wait for events, CyclicBarrier for rounds, Semaphore to limit access, and Phaser for flexible multi-phase work.
- कॉन्करेंट कलेक्शन Learn Java concurrent collections - ConcurrentHashMap with atomic merge and compute, CopyOnWriteArrayList, BlockingQueue producer-consumer, and ConcurrentLinkedQueue.
- Fork/Join फ़्रेमवर्क Learn the Java Fork/Join framework - RecursiveTask and RecursiveAction, divide-and-conquer sums and sorts, thresholds, work stealing, and how parallel streams use it.
- वर्चुअल थ्रेड और स्ट्रक्चर्ड कंकरेंसी Learn Java virtual threads - how they differ from platform threads, newVirtualThreadPerTaskExecutor, pinning, scoped values, and structured concurrency with StructuredTaskScope.
- ThreadLocal और ScopedValue Learn Java ThreadLocal for per-thread state, why it leaks in thread pools, how InheritableThreadLocal behaves, and how ScopedValue (final in Java 25) replaces it safely.
- Timer और ScheduledExecutorService Schedule delayed and repeating tasks in Java with Timer and ScheduledExecutorService - fixed rate versus fixed delay, cancelling, error handling and clean shutdown.
Networking
- नेटवर्किंग की बुनियादी बातें Learn the networking basics every Java developer needs - IP addresses, ports, TCP vs UDP, DNS, InetAddress, parsing URIs and URLs, and talking to 127.0.0.1.
- TCP सॉकेट Learn Java TCP socket programming - ServerSocket and Socket, an echo server and client, reading and writing over streams, timeouts, many clients and closing properly.
- DatagramSocket के साथ UDP Learn UDP in Java with DatagramSocket and DatagramPacket - sending and receiving packets, replies, timeouts, lost packets, retries and when UDP beats TCP.
- Java HTTP क्लाइंट Learn the java.net.http HttpClient - GET and POST requests, headers, status codes, body handlers, async calls, timeouts and redirects, tested against a local HttpServer.
- रिमोट मेथड इन्वोकेशन (RMI) Learn Java RMI - remote interfaces, exporting objects, the registry, stubs, serialized arguments, remote exceptions and callbacks - with a loopback demo you can run.
Desktop GUI
- Java GUI का परिचय: AWT, Swing और JavaFX Compare Java's desktop GUI toolkits - AWT, Swing and JavaFX - their history and design, where desktop Java is used today, headless mode and how to run GUI code locally.
- Swing की बुनियादी बातें Learn Swing basics - JFrame, JPanel, JLabel, JButton and JTextField, the BorderLayout, FlowLayout and GridLayout managers, nesting panels and the event dispatch thread.
- Swing लेआउट मैनेजर Go beyond the basics with Swing layout managers - BoxLayout alignment and glue, GridBagLayout constraints and weights, CardLayout decks and when to nest panels.
- Swing इवेंट और एक छोटा ऐप Handle Swing events with ActionListener lambdas, Actions and document listeners, build a temperature converter app and keep it responsive with SwingWorker.
- Swing कंपोनेंट - टेबल, लिस्ट, ट्री और डायलॉग Learn the Swing data components JTable, JList, JComboBox and JTree, how their models work, plus JOptionPane dialogs and menus, with runnable model examples.
- JavaFX परिचय Get started with JavaFX - Application, Stage, Scene and nodes, layout panes, event handlers, properties and binding, FXML and CSS, and how to set up OpenJFX.
JVM and Advanced Topics
- मेमोरी और गार्बेज कलेक्शन Understand Java memory - stack vs heap, references and reachability, generational garbage collection, G1 and ZGC, memory leaks, Runtime stats and soft and weak references.
- Soft, Weak और Phantom रेफ़रेंस Learn Java reference types - strong, soft, weak and phantom references, ReferenceQueue, WeakHashMap and Cleaner - with runnable examples and cache guidance.
- JVM आर्किटेक्चर और क्लास लोडिंग How the JVM works inside - class loaders and delegation, loading, linking and initialization, the runtime data areas, bytecode you can read, and JIT tiers.
- एनोटेशन Learn Java annotations - @Override, @Deprecated and friends, defining your own, retention and targets, repeatable and inherited annotations, and reading them at run time.
- रिफ़्लेक्शन (Reflection) Learn Java reflection - Class objects, inspecting and changing fields, invoking methods, creating instances, setAccessible and modules, proxies and method handles.
- Java मॉड्यूल सिस्टम (JPMS) Learn the Java Platform Module System - module-info.java, requires, exports, opens and services, strong encapsulation, the module path, and custom runtimes with jlink.
- ServiceLoader और सर्विस प्रोवाइडर पैटर्न Learn how Java's ServiceLoader finds plugins at run time, how to register providers with META-INF/services, lazy streams, error handling and design tips.
- ऑब्जेक्ट-ओरिएंटेड डिज़ाइन सिद्धांत (SOLID) Learn the SOLID principles in Java - single responsibility, open/closed, Liskov substitution, interface segregation and dependency inversion - with runnable before/after code.
- क्रिएशनल डिज़ाइन पैटर्न Learn creational design patterns in Java - singleton (enum and lazy holder), static factories, factory method, abstract factory, builder and prototype - with runnable code.
- स्ट्रक्चरल और बिहेवियरल डिज़ाइन पैटर्न Learn the essential structural and behavioral design patterns in Java - adapter, decorator, facade, proxy, composite, strategy, observer, command, iterator, template method, state.
- JUnit के साथ यूनिट टेस्टिंग Learn unit testing in Java with JUnit - why tests matter, @Test methods, assertions, the Arrange-Act-Assert pattern, reading failures and writing good tests.
- बिल्ड टूल: Maven और Gradle Learn why Java projects use build tools, the standard project layout, dependencies, pom.xml and build.gradle.kts basics, and how JAR files and the classpath work.
- लॉगिंग (Logging) Learn Java logging - why println isn't enough, java.util.logging loggers, levels, handlers, formatters and config files, System.Logger and an SLF4J overview.
- Java परफ़ॉर्मेंस के सुझाव Make Java code faster the right way - measure with nanoTime and JMH, avoid boxing and string concatenation in loops, pick the right collection, cache and profile.
- बेस्ट प्रैक्टिस और आम गलतियाँ Avoid the Java mistakes that compile but break programs - == on objects, equals without hashCode, null leaks, mutable state, money in double, resource leaks and more.
- Java के संस्करण और इतिहास A guided tour of Java's history from 1.0 to Java 25 - LTS releases, the six-month cadence, headline features of each version, preview features and Runtime.version().
- Java में सुरक्षित कोडिंग Write safer Java. Validate input with allow-lists, stop path traversal and SQL injection, use SecureRandom, hash passwords with PBKDF2, filter deserialization.
- नेटिव कोड: JNI और Foreign Function API Call C libraries from Java. Compare the old JNI with the modern Foreign Function and Memory API: Linker, Arena, MemorySegment, downcalls and upcalls.
- JVM विकल्प और GC ट्यूनिंग Learn the JVM flags that matter: heap sizing with -Xms and -Xmx, container settings, choosing G1, ZGC, Parallel or Serial, GC logs, OOM handling and JFR.
- JFR और VisualVM से प्रोफ़ाइलिंग Record with Java Flight Recorder, read hot methods, write custom JFR events, take heap dumps and use VisualVM.
- JMH से बेंचमार्किंग Measure small pieces of Java code correctly. Learn why naive timing fails, then use JMH with @Benchmark, @State, @Param, Blackhole, forks and warm-up.
Projects
- प्रोजेक्ट: नंबर गेसिंग गेम Build a number guessing game in Java step by step - Random with a seed, an input loop, hints, attempt limits, difficulty levels, replays and a computer that guesses.
- प्रोजेक्ट: ग्रेड बुक Build a Java grade book step by step. Read scores from input, validate them, compute weighted averages and letter grades, and print a neat class report.
- प्रोजेक्ट: बैंक अकाउंट सिस्टम Build a Java bank account system in stages with encapsulation, BigDecimal money, custom exceptions, checking and savings subclasses and a transaction history.
- प्रोजेक्ट: लाइब्रेरी मैनेजमेंट सिस्टम Build a Java library system in stages - books, members and loans with records and maps, due dates and fines with java.time, search, reports and text commands.
- प्रोजेक्ट: इन्वेंटरी मैनेजर Build a Java inventory manager in stages. Parse CSV data into validated records, store products in a map, update stock immutably and build stream reports.
- प्रोजेक्ट: टेक्स्ट एनालाइज़र Build a Java text analyzer in stages. Count words and sentences with regular expressions, rank word frequencies with HashMap and streams, and print a full report.
- प्रोजेक्ट: टिक-टैक-टो Build Tic-Tac-Toe in Java step by step - a 2D array board, enums for players, moves from input, win and draw detection, and a computer opponent you can beat.
- प्रोजेक्ट: एम्प्लॉई मैनेजमेंट सिस्टम Build an employee management system in Java - records, a repository interface, CRUD commands from input, stream reports and file persistence that survives a restart.
- प्रोजेक्ट: स्नेक गेम Build the Snake game in Java - a testable game model with a deque, tick logic and collisions, buffered key presses, a BFS autopilot and a Swing window.
- प्रोजेक्ट: Swing टेक्स्ट एडिटर Build a text editor in Java - a document model with undo and redo, find and replace with regex, safe open and save with NIO, and a Swing window with menus.
- प्रोजेक्ट: मल्टी-क्लाइंट चैट सर्वर Build a multi-client chat server in Java with ServerSocket and a virtual thread per client - nicknames, private messages, commands, broadcasting and clean shutdown.
- प्रोजेक्ट: ATM सिमुलेशन Build a Java ATM simulator with a hashed PIN check and lockout, BigDecimal balances, per-transaction and daily withdrawal limits, note dispensing and a transaction log.
- प्रोजेक्ट: करेंसी कन्वर्टर Build a Java currency converter with an exchange-rate map, cross rates through a base currency, BigDecimal rounding by currency, fees and Locale-aware money formatting.
- प्रोजेक्ट: साइंटिफ़िक कैलकुलेटर Build a Java scientific calculator that parses expressions like sin(pi / 2) + 2 ^ 3 with a tokenizer, the shunting-yard algorithm, sealed token types and Math functions.
- प्रोजेक्ट: मेमोरी कार्ड गेम Build a Java memory matching game with a testable game-state model, bots that prove the rules work, and a Swing grid view with javax.swing.Timer for flipping and the clock.
- प्रोजेक्ट: एक सरल सर्च इंजन Build a small Java search engine with a tokenizer, an inverted index, term frequency and TF-IDF ranking, prefix and exclusion queries, highlighted snippets and live add and remove.
- प्रोजेक्ट: सुडोकू सॉल्वर Build a Java Sudoku validator and solver with backtracking, then speed it up with bitmasks and the fewest-candidates rule, count solutions and generate puzzles with one answer.
- प्रोजेक्ट: सुपरमार्केट बिलिंग सिस्टम Build a Java supermarket billing system with a product catalog, a cart, sealed discount rules, tax on taxable items and an aligned receipt, all with exact BigDecimal money.
- प्रोजेक्ट: वर्ड काउंटर Build a Java word counter step by step. Tokenize text with a regex, count with Collectors.groupingBy, sort a top-N report, read files and stdin, and write a small CLI.
Data Structures and Algorithms
- Java में डेटा स्ट्रक्चर Implement a dynamic array, stack, queue, singly linked list and binary search tree in Java with generics, then learn when to use the built-in collections.
- सर्चिंग और सॉर्टिंग एल्गोरिदम Implement linear and binary search plus bubble, selection, insertion, merge, quick and heap sort in Java, with step-by-step traces, Big-O, stability and timings.
- ग्राफ़, रिकर्शन और बैकट्रैकिंग Build graphs in Java with adjacency lists, explore them with BFS and DFS, find shortest paths and run Dijkstra with PriorityQueue, then solve puzzles with backtracking.
- समस्या-समाधान के पैटर्न Learn three reusable Java patterns - two pointers, sliding window and prefix sums - and turn slow O(n squared) loops into O(n) solutions with runnable code.
Practice and Review
- Java चीट शीट (Cheat Sheet) A one-page Java 25 cheat sheet with syntax, types, strings, control flow, OOP, records, exceptions, collections, lambdas, streams, dates, files and threads.
- Java प्रोग्राम: 40 क्लासिक उदाहरण 40 classic Java programs you can run - primes, palindromes, factorials, Fibonacci, GCD, Armstrong numbers, anagrams, matrices, patterns, sorting and more.
- Java में फ़ाइल और डायरेक्टरी प्रोग्राम Practice Java file handling with runnable programs - create, rename, copy and append files, compare paths, grep, measure and delete folders, search trees and read ZIP entries.
- Java में क्लास और ऑब्जेक्ट प्रोग्राम Practice object-oriented Java with runnable programs - singleton, static members and init order, overriding vs overloading, data hiding, abstract classes and access modifiers.
- Java में एक्सेप्शन और थ्रेड प्रोग्राम Practice Java exceptions and threads with runnable programs - multi-catch, Error vs Exception, unreachable code, thread states, sleeping safely, join, daemon threads and race conditions.
- Java प्रैक्टिस एक्सरसाइज़ 30 graded Java exercises with solutions on strings, loops, arrays, recursion, classes, records, exceptions, collections, streams and threads. Run them online.
- Java इंटरव्यू प्रश्न 60 common Java interview questions with clear answers, from == vs equals and OOP to HashMap internals, streams, concurrency, garbage collection and Java 25.