Provide Best Programming Tutorials

How to read/write from/to file in Java

Three ways to do this FileIutputStream and FileOutputStreamDataInputStream and DataOutputStreamBufferedInputStream and BufferedInputStream FileIutputStream and FileOutputStream package FileDemo; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class ReadAndWriteContentWithFile { public static void…

Continue Reading

Log4j2 Example

Import Maven dependency <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core --> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.12.1</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api --> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.12.1</version> </dependency> Configuration File <?xml version="1.0" encoding="UTF-8"?> <Configuration status="INFO"> <Properties> <Property name="logPath">./</Property> <Property…

Continue Reading
Close Menu