Is there an auto
variable type in Java like you have in C++?
An example:
for ( auto var : object_array)
std::cout << var <<
Java 7 introduces the diamond syntax
Box integerBox = new Box<>(); // Java 7
As compared to old java
Box integerBox = new Box(); // Before Java 7
The critical reader will notice that this new syntax doesn't help with writing the for loops in the original question. That's correct and fully intentional it seems. See the other answer that cites Oracle's bug database.