Introduction to Design Patterns

What are Design Patterns? What is a Pattern? Patterns exist everywhere in the world. In culinary, art, medicine, law, mathematics, music, dancing and the list goes on. Genrally, a pattern is identified as a recurring arrangement created to solve some generalized problem. It is simply a solution outline. That solution outline can be used over and over … Read more

Stack-Walking API – Java 9

A stack trace is a list of method calls arranged in such a way that the method at which an exception was thrown will be at the top followed by the caller to that method and so on till the main method of the program. We can print a stack trace to the console by … Read more

Multi-Resolution Images API – Java 9

Java 9 introduced a new interface called MultiResolutionImage (JEP 251) to encapsulate a set of images with different resolutions into a single multi-resolution image. The APIs related to multi-resolution images are available under java.awt.image package and helps us to programmatically: Get all variants of a particular image. Get an image specific to the resolution required based … Read more

Process API enhancements in Java 9

The java.lang.Process class provides methods to get input or output from a process, wait for process to complete, check exit status or kill the process. From Java 7 onwards, the process streams could be redirected to files. In Java 9, certain enhancements(JEP 102) were done to the Process API and a new interface called ProcessHandle … Read more

Tiered Attribution for javac – Java 9

In Java 8, the implementation of type-checking at compiler level was based on Speculative Attribution. In Speculative Attribution, the same tree can be type-checked against multiple targets at runtime. This is particularly used in target typing for lambda expressions, resolving diamond expressions for generics, etc. To understand more about target typing in lambda expressions, we … Read more