Tag Archives: java

Java – Task polling example with Java 8

Advertisements

Posted in Java, Programming | Tagged | Leave a comment

Java – Predefined funtional interface

1. Void return and zero paramter Use Runnable 2. Return value and zero paramter Use Supply 3. Return void and 1 parameter Use Consumer 4. Generic case Use Action0, Action1, Action2 …

Posted in Java, Programming | Tagged | Leave a comment

Java – Try with resources

From Java7, it introduced the mechanism to release the resource automatically as C# does with using statement. In C#, you can use the using statement to release resource allocated by object which derives from IDisposable. Java7 can achieve same result … Continue reading

Posted in Java, Programming | Tagged | Leave a comment

Java – loading a resource file in unit test code

Posted in Java, Programming | Tagged | Leave a comment

Java – Spring framework – adding property file in application

1. Add the following code in applicationContext-config.xml 2. get an instance of myPropertes in code

Posted in Java, Programming | Tagged | Leave a comment

Java – create a Java application with Maven

With the following command you can create an application directory quickly

Posted in Java, Programming | Tagged | Leave a comment

Java – a generic Java class instantiation example

Posted in Java, Programming | Tagged | Leave a comment