How to get file last modified date in Java
In Java, we can use Files.readAttributes() to get the file metadata or attribute, and then lastModifiedTime() to display the last modified date of a file. For legacy IO, we can…
Favourite tutorials for developers
Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need to recompile.
In Java, we can use Files.readAttributes() to get the file metadata or attribute, and then lastModifiedTime() to display the last modified date of a file. For legacy IO, we can…
In Java, we can use String.contains() to check if a String contains a substring. We can also check the substring by using indexOf().
In this article, we will examine some example to convert String to Char array vise verse.
In Java, we use StringTokenizer to split a string into multiple tokens. The StringTokenizer is a legacy class, try the split method of String.
This article shows you how to use the JDK1.5 String.format() and Apache Common Lang to left or right pad a String in Java.
This article shows you how to format a string in Java, via String.format(). We will examine how to control String format with argument, how to format Integer, Floating Points as…
In Java, we can use DateTimeFormatter to convert the FileTime to other custom date formats.
In Java, we can use the NIO Files.setLastModifiedTime(path, FileTime) to update the last modified date or time of a file. For legacy IO java.io.File, we can use File.setLastModified() to update…
The Files.find API is available since Java 8. It searches or finds files from a file tree quickly. Examples: Find files by filename, Find files by file size, Find files…
In Java, we can use the static or non-static ways to get the path of a running JAR file. We should use toURI() to avoid encoding the special characters in…