JavaBrahman

135 Flips | 6 Magazines | 4 Likes | 22 Following | 45 Followers | @JavaBrahman | JavaBrahman.com is a tech blog publishing on areas around Java, JEE, Design Patterns and JavaScript...

Java 9 - How to create immutable collections using List.of, Set.of, Map.of, Map.ofEntries methods with examples

Introduction <br>This tutorial explains how to use Java 9 <b>Collections’</b> new factory methods for creating immutable collection instances with examples to …

JavaScript

Overview of New features in Java 10

Local Variable Type Inference – This is one of the most significant and widely awaited changes in JDK 10. Java now supports local variable …

Understanding Thread Life Cycle, Thread States in Java | Tutorial with Examples

New – A newly created thread object instance on which the start() method has not yet been invoked is in the new state. To learn how to instantiate …

What's new in latest version of Android Operating System - Android O

Google’s annual developer conference ‘Google I/O’ is underway from 17th to 19th May. One of the most important product releases coming up later this …

Java Multithreading Basics | Creating and running threads in Java with examples

This tutorial covers the basic concepts of multithreading in Java. It begins with explaining what is multithreading, and then shows how to create …

How to delete a file or directory in Java using NIO API

Tutorial shows how to delete a file or directory in Java using NIO API’s java.nio.file.Files class’s delete() and deleteIfExists() methods. For each …

Understanding Functional Interfaces - Java 8 Tutorials Part 1

How to get file attributes or permissions in Java with examples

This tutorial shows how to get the file attributes for a given file in Java with examples. It uses the Path and Files classes from the Java NIO API …

Java

How to Print array in Java using Arrays.toString,Arrays.deepToString, Arrays.stream methods

This quick coding tip shows how to print array in Java for both one dimensional and multi-dimensional arrays.<p>If you invoke …

How to get user's current working directory or Java Execution Path

In this quick coding tip we will see how to get user’s current working directory or Java execution path using java.lang.System class.<p>Java code for …

How to copy or move a file in Java from one location to another with examples

First an instance of java.nio.file.FileSystem is created using the FileSystems.getDefault() method.<p>FileSystem provides access to the underlying file …

Java - How to recursively list all files and subdirectories in a directory with examples

This code tip shows how to use Java NIO API to recursively list all sub-directories and files in a given directory.<p>The directory structure iterated …

How to perform elementary Date-Time calculations in Java 8

java.util.LocalDate is Java8’s immutable date class without a timezone.<p>We create an instance of LocalDate, named baseDate, using the static of() …

Java 8 - How to count words in a text file in java using NIO and Streams API

The get() method of <b>NIO API’s</b> java.nio.file.Paths class is used to get the java.nio.file.Path handle, named textFilePath, to the text file …

Java 8 - How to convert String to LocalDate and LocalDate to String in specific format

This Java 8 code tip first shows <b>how to convert</b> String <b>date to</b> java.time.LocalDate instance using the parse() method of java.time.DateTimeFormatter …

Java 8 - How to convert java.util.Date to java.time.LocalDate, java.time.LocalDateTime with examples

The above example starts with creating a new java.util.Date instance, named java7Date. This creates an instance of Date containing date, time and …

Java 8 - How to get last day / last working day of a month as LocalDate

This Java 8 coding tip first shows how to get the last day of a given month as a java.time.LocalDate instance. It then shows how to get the last …

Java 8 - How to Day of Week, Month in Spanish, French for any date using Locale

This quick code tip shows how to get localized day of the week and month for a date(java.time.LocalDate/LocalDateTime) in French or Spanish using …

Java 8 - How to get day of week for a given date using java.time.DayOfWeek with examples

The DayOfWeekExample class first creates an instance of java.time.LocalDate class, named localDate, using its of() method. The variable holds the …

Java

How to count number of files in a directory in Java | File.list() vs NIO's DirectoryStream

This quick code tip how to count number of files in a directory in Java with code examples. It shows two approaches to code for the problem. First …

Linux

How to check for existence of a file in Java

The above class FileExists checks for existence of 2 files – xyz.txt<i>(which doesn’t exist)</i> and file1.txt(which exists) at their respective paths …

Implementing Iterable interface in Java to enable for-each loop based iteration

This tutorial explains how to implement java.lang.Iterable<T> on a class to enable <i>for-each loop</i> based iteration through the collection of objects …

Java 8 How to use Collectors summarizingInt, summarizingLong, summarizingDouble with examples

This tutorial explains how to use the predefined <i>summarizing collectors</i> returned by Collectors.summarizingInt(), Collectors.summarizingLong() and …

Java 8 – How to use Collectors.mapping Collector with examples

This tutorial explains how to use Java 8’s predefined collector returned by Collectors.mapping() method with examples. It first explains the …

Java 8 – How to use Collectors.toCollection Collector with examples

This tutorial explains how to use Java 8’s predefined collector returned by Collectors.toCollection() method with examples. It first explains the …

The Complete Java Enums Tutorial with Examples

This tutorial explains the fundamentals of Java enums with examples. It starts with defining enum types. Next it explains where enums can be defined …

Latest Articles & Tutorials on Java, J2EE, Design Patterns, JavaScript, & HTML5

Posted: April 24, 2018<p>This tutorial explains how to create immutable collections using Java 9 Collections API’s new factory methods List.of(), …

JavaScript

Java 8 How to use Collectors averagingInt, averagingLong, averagingDouble with examples

This tutorial explains how to use the predefined <i>averaging collectors</i> returned by Collectors.averagingInt(), Collectors.averagingLong() and …

Java 8 - How to use Collectors.collectingAndThen Collector with examples

This tutorial explains how to use the predefined collector returned by Collectors.collectingAndThen() method with examples. It first explains the …

Java 8 Grouping with Collectors | groupingBy method tutorial with examples

Introduction – Java 8 Grouping with Collectors tutorial explains how to use the predefined Collector returned by groupingBy() method of …