Java 8 – Convert Iterator to Stream

Although not a common scenario, some libraries just return Iterator instead of actual Stream or Collection objects.

Convert a Stream to List in Java 8

So, you’ve been planning to learn the new stuffs made available in Java 8. One of them is the Stream interface. Given a collection, e.g., List, a Stream can be extract using

Java Primitive Float And Double – What’s the difference?

Any floating-point literal in Java is by default of a double type.

Java – Beyond String Pool

The String Pool is a location in the Java Virtual Machine (JVM) that collects all the literal Strings from your codes. Java keeps unique Strings for reuse.

Java – How to pass argument string with spaces to Java

The way you run your application in Java is by invoking java followed by the class name (without the .class extension).

How to read user input from keyboard in Java

Background This article demonstrates how to read input supplied by user via keyboard to the console. Software Environment Windows 7 Professional SP1 Eclipse – Kepler Release Java 1.7 (1.7.0_67 –

Java 9 Stream filter, takeWhile, dropWhile methods

This post demonstrates how to use the new methods – takeWhile and dropWhile – of the Stream interface in Java 9 Jigsaw. We’ll touch briefly on Stream.filter(Predicate p) just to get comfortable before trying out the new methods.

Java – Using ExecutorService, AutoCloseable, and Try-With-Resources

This post demonstrates how to use try-with with ExecutorService in Java.

Java – Closing JDBC Database Resources with try-with-resources

This post demonstrates how to use try-with-resources to close JDBC database resources in this order – ResultSet, Statement, and Connection.

Java Formal Type Parameter Methods We Can Invoke

With Java Generics, we name Java Formal Type Parameter T, E, K, and V conventionally. If an instance of a Format Type Parameter, what available methods we can invoke on