Convert LocalDate to LocalDateTime in Java and Back
Convert LocalDate to LocalDateTime in Java with atStartOfDay() and atTime(), and back with toLocalDate(), plus zone-aware day starts and day ranges.
“Core Java” is Sun’s term, used to refer to Java SE, the standard edition and a set of related technologies, like the Java VM, CORBA, etc. This is mostly to differentiate from others like Java ME or Java EE. “Core Java” is Oracle’s definition and refers to subset of Java SE technologies.
The Core Java technologies and application programming interfaces (APIs) are the foundation of the Java Platform, Standard Edition (Java SE). They are used in all classes of Java programming, from desktop applications to Java EE applications.
Convert LocalDate to LocalDateTime in Java with atStartOfDay() and atTime(), and back with toLocalDate(), plus zone-aware day starts and day ranges.
Parse String to ZonedDateTime in Java with ISO text, VV and XXX patterns, ambiguous names like PST or IST, and strings that have no time zone.
Convert a string to LocalDateTime with LocalDateTime.parse() and DateTimeFormatter. Learn the ISO format, pattern letters, AM/PM and Locale, strings with a zone, date-only strings, strict parsing and common error messages.
Convert String to LocalDate in Java with LocalDate.parse(), custom patterns, month names in any locale and safe DateTimeParseException handling.
Java ZonedDateTime examples on Java 25. Create, parse and format zoned date-times, handle DST gaps and overlaps, and convert a time between zones.
Java LocalDateTime examples on Java 25. Create, parse and format date-times, add hours, compare values and convert to ZonedDateTime without DST surprises.
Java LocalTime examples on Java 25. Create, parse and format times, add hours across midnight, check opening hours and measure the time between two times.
Java LocalDate examples on Java 25. Create, parse and format dates, add days and months, compare dates and convert LocalDate to other date types.
Java stream filter with multiple conditions using && and ||, chained filter() calls and Predicate and(), or(), negate(), plus dynamic search filters.
Join a stream of strings in Java with Collectors.joining() or String.join(), with a delimiter, prefix and suffix, null elements and empty streams.
Java Stream concat() merges two streams lazily. Learn to merge many streams, append or prepend items, remove duplicates and concat IntStream on Java 25.
Sort by multiple fields in a Java stream with comparing() and thenComparing(), mix ascending and descending order, handle nulls and pick keys at runtime.
Learn how to sort a stream in Java by numbers, strings, object fields, descending order and null values, plus sorting map entries and collecting results.
Convert a Java Stream to List with toList() or Collectors.toList(). Compare modifiability, null items and Java versions, plus ArrayList and IntStream.
Java Stream toArray() converts a stream to an array. Learn the String[]::new generator, int[] from primitive streams, ArrayStoreException and toList().
Collect a Java Stream to Map with Collectors.toMap(), handle duplicate keys and null values, and pick LinkedHashMap, TreeMap or an unmodifiable map.
Java stream reuse explained with Supplier, collect-once lists, reusable pipeline steps and one-pass collectors like teeing, plus one-shot sources.
Java Stream findFirst vs findAny explained. findFirst() keeps encounter order, while findAny() may return any element in parallel streams. With null rules.
Java Stream anyMatch() checks if any element matches a predicate. Learn allMatch(), noneMatch(), empty stream results and short-circuiting with examples.
Java Stream limit() keeps the first n elements and skip() drops them. Learn edge cases, infinite streams, takeWhile() and a pagination helper with code.
Java Stream peek() explained with element order, cases where count(), findFirst() and limit() skip it, peek vs map vs forEach, parallel streams and logging
map vs flatMap in Java explained with side-by-side examples, a comparison table, Optional map() vs flatMap(), mapMulti() and when to use each method.
Learn Java Stream flatMap() with examples to flatten a list of lists, split lines into words, unwrap Optional values and use flatMapToInt() in Java 25.
Learn the Java Stream map() method with examples for type conversion, field extraction, DTO mapping, mapToInt(), laziness and map() vs flatMap().
Java Stream max() examples with comparators, max by field, ties, empty streams, groups and primitive streams, plus comparators that return wrong results.
Java Stream sorted() examples that sort in natural, reverse and custom order with Comparator, records and nulls, plus how it compares with List.sort().
Learn the Java Stream filter() method with predicates, lambdas, Predicate.not(), null and map filtering, filter() vs removeIf() and real-world examples.
Java Stream forEach() runs an action on every element. See parallel order, forEachOrdered(), shared state, stopping early and checked exceptions.
Secure random number generation in Java with SecureRandom. Create tokens and codes, pick NativePRNG, DRBG or getInstanceStrong and avoid seeding mistakes.
Learn JMeter 5.6.3 step by step: build a test plan with a thread group, HTTP requests, an assertion and think time, run it in CLI mode and read the HTML report.
If-else logic in Java streams with filter(), map() with a ternary or switch, partitioningBy(), groupingBy() and Optional, plus a bank statement example
Java forEach() on List, Set and Map with Consumer and BiConsumer, iteration order, forEach vs for loop, break and ConcurrentModificationException
Find the union of two arrays in Java with LinkedHashSet, IntStream distinct() and a two-pointer merge for sorted input, with order and duplicates covered.
Find the intersection of two arrays in Java with retainAll(), a HashSet filter, a count map for repeats and two pointers for sorted arrays.
Java Stream distinct by multiple fields with a distinctByKey() predicate, a record key, toMap() or a Gatherer, and why parallel streams change the result.
Instance initializer block in Java with examples, covering execution order with fields and constructors, this() chaining, exceptions and double braces.
Java naming conventions for packages, classes, methods, variables, constants and generics, with identifier rules, examples, a refactoring and style guides.
Learn this and super in Java, this() vs super() constructor calls, Interface.super, Java 25 flexible constructor bodies and static context rules.
Learn what the strictfp keyword in Java did before Java 17, why JEP 306 made it obsolete, its syntax rules, and how to remove it from old code.
Learn the difference between final, finally and finalize in Java, with examples, when finally does not run, and what replaces deprecated finalize().
Learn extends vs implements in Java with examples, a comparison table, using both in one class, interfaces extending interfaces, generics bounds and FAQs.
The Java instanceof operator checks the type of an object. Learn null handling, pattern matching, generics, arrays, switch patterns and isInstance().
throw vs throws in Java compared with a table and examples, plus exception propagation, rethrowing and the throws rules for overriding methods.
Learn the Java synchronized keyword with methods and blocks, which lock each form uses, reentrancy, visibility, deadlocks and virtual threads.
Java try catch finally with runnable Java 25 examples, the order the blocks run, multiple catch blocks, return in finally and when finally is skipped.
Learn the Java boolean type, default values, short-circuit operators, the Boolean wrapper, parseBoolean vs getBoolean, and boolean memory size.
Learn the Java assert keyword, enabling assertions with -ea, AssertionError, when to use assert vs exceptions, side effects, and assertions in tests.
Learn the abstract class in Java with examples, abstract methods, illegal modifier combinations, abstract class vs interface, and sealed hierarchies.
Java control flow statements explained with if-else, switch, for, while, do-while, break, continue and yield, with examples and links to each tutorial.
Java CopyOnWriteArraySet explained with examples, snapshot iteration, O(n) costs, a chat room use case and a comparison with ConcurrentHashMap.newKeySet().
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.