The conditional operator is very similar to the if/else or switch conditional statements and is the only operator in Java that takes three operands. Therefore, conditional operator is also known as ternary operator. This operator not only has three operands but can also be used in variety of ways to make the code more concise. So, we take a deeper than… Continue reading Java Ternary Operator a.k.a Conditional Operator
Arrays In JavaScript
This article examines the most popular data structure in JavaScript – arrays. We have already examined arrays in Java in a great detail. This post was written as one of the readers asked a comparison of the most popular data structure viz. array in two of the most popular programming languages viz. Java & JavaScript. What are arrays?… Continue reading Arrays In JavaScript
Java EnumMap with Example
Java EnumMap is a Java Map that uses keys of a single enum type. EnumMap utilizes the inherent associative nature of arrays and is therefore the most efficient implementation of Map. In a nutshell, EnumMap is a one-trick-pony designed to be used when the keys of your Map are constants and therefore can be made static and final. Constructors of EnumMap… Continue reading Java EnumMap with Example