Data Structures, Conditionals, and Iteration
Abstract
Java is one of the most capable programming languages in use today. Java powers the desktop, the enterprise, the Web, mobile devices, and much more. As a Java developer, regardless of which space you are working in, there are some parts of the language that you use occasionally as needed, other parts of the language that you use rarely, and those parts of the language that you likely use on a regular basis. In this Chapter, we present a variety of recipes covering topics that fall into the latter category. All Java applications require the use of data structures, iteration, and conditional control flow. You will find recipes covering the use of classes from the Java Collections Framework as well as Java arrays. If you are a new Java developer, there is a recipe to get you up to speed quickly on the use of generic types with the Collection classes. Regardless of your level of Java experience, be sure to check out this recipe to read about a new Java 7 feature, the diamond syntax, which will make your life easier if you are doing a lot of generics programming. In the iteration category, you may find the recipes on the use of the Iterable interface, the enhanced for loop, and Map iteration useful. There is a recipe that demonstrates a longawaited addition to the language, finally appearing in Java 7: the ability to use Strings in the switch statement.KeywordsSwitch StatementCollection TypePublic VoidEnum TypeStock ListThese keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Related Papers
- → Compatible genericity with run-time types for the Java programming language(1998)139 cited
- Java in easy steps: Covers Java 8(2014)
- → NetRexx-an alternative for writing Java classes(2002)
- Mastering Java 11 Ed. 2(2018)
- → Identifying Reference Objects by Hierarchical Clustering in Java\n Environment(2011)