Daily Archives: June 6, 2011

how to use FileUtils in java

add this dependency in pom file <!–appache common IO –> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-io</artifactId> <version>1.3.2</version> </dependency> package org.kodejava.sample.commons.io; import org.apache.commons.io.FileUtils; import java.io.File; import java.io.IOException; public class ReadFileToStringSample { public static void main(String[] args) { // In this example we use FileUtils … Continue reading

Posted in java | 1 Comment

Concurrency with java

public class Driver { static int N = 10; public static void main(String[] args) throws InterruptedException { /* * CountDownLatch ==>A synchronization aid that allows one or more * threads to wait until a set of operations being performed in … Continue reading

Posted in java | Leave a comment