Author - Mathan Lal

Date and Time

How to sort dates in java

public final class DateTimeFormatter extends Object Formatter for printing and parsing date-time objects. public final class LocalDate extends Object A date...

Date and Time

Java compare dates

int compareTo(T o) Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less...

Date and Time

Simple date formatter java

public class SimpleDateFormat extends DateFormat SimpleDateFormat is a concrete class for formatting and parsing dates in a locale-sensitive manner. It allows...

java files

Java byte array to file

public static Path write(Path path,byte[] bytes,OpenOption… options)throws IOExceptionWrites bytes to a file. The options parameter specifies how the the file...

java files

Java file to byte array

package com.candidjava.file; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileReader; import java.nio.file.Files; import java.nio...

java files

How to write to a file in java

public class FileWriter extends OutputStreamWriterConvenience class for writing character files. The constructors of this class assume that the default...

java files

Java move file to another path

public static Path move(Path source,Path target,CopyOption… options)throws IOExceptionMove or rename a file to a target file.By default, this method attempts...

java files

Get file extension in java

package com.candidjava.file; import java.io.File; public class FileExtension { public static void main(String[] args) { File file = new File("demo.txt");...