java 8

How to iterate (loop) over the elements in a Map in Java 8 alvin February 5, 2017 - 3:44pm

If you need to iterate over the elements in a Map in Java 8, this source code shows how to do it:

Map<String, String> map = new HashMap<String, String>();
map.put("first_name", "Alvin");
map.put("last_name",  "Alexander");

// java 8
map.forEach((k,v)->System.out.println("key: " + k + ", value: " + v));

How to build a Mac Java app (OS X 10.9+ and Java 7+)

As a quick note to self, I used the following Ant build.xml file in 2014 to build my Wikipedia Reader client application on Mac OS X 10.9 with Java 7.x:

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

Java architect's thoughts on Java 7 and Java 8

I just ran across this link in my email about the Chief Architect of the Java Platform Group at Oracle, with his thoughts about how to proceed on the Java 7 and Java 8 platforms releases. I haven't paid attention to the "New Java Features" world in a while, but it's a short, interesting read about how they're thinking about proceeding with the Java 7 and Java 8 platform releases.

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

Java 5 for loop syntax example (Java 5 Generics)

Java FAQ: Can you show me an example of the Java 5 for loop syntax? (Java 5 and newer)

Answer: Sure. I've created a sample Java program to demonstrate the Java 5 for-each loop syntax, using both a List with pre-Java5 syntax, and a second example using Java 5 generics syntax.

Java 5 for loop syntax example

Without any further ado, here is the example code:

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.