Blog Archives

01: Java 9+ modules interview Q&As

Q01. What is a module in Java? A01. You can think of the Java Platform Module System (JPMS) as a higher level of aggregation above packages. A Java module is a set of packages that declares which of them form an API accessible to other modules and which are internal…

Read more ...


02: Java 9 to 20 features interview Q&As – var & switch expressions with patterns

Java 8 introduced features like Lambda expressions, Functional interfaces, Default methods in interfaces, Stream API, Optional class, etc. Java 9 to 20 made many enhancements to Java as discussed below. Q01: What are some of your favourite features in Java 9 to 17? A01: Java 9+ introduced Java Platform Module…

Read more ...


03: Java 9 to 20 features interview Q&As – text blocks

Q01: What are text blocks? A01: Java 15 introduced text blocks feature to declare multi-line strings. Prior to Java 15

Read more ...


04: Java 9 to 20 features interview Q&As – Records

Q01: What is a data class?
A01: A data class refers to a class that contains only fields and methods for accessing them via getters and setters. These are simply containers for data used by other classes.

Q02: What exactly makes creating data classes in Java so tedious?
A02: In addition to defining the data fields & types, the data class (aka POJO – Plain Old Java Object) requires constructors, getters, and setters.… Read more ...



05: Java 9 to 20 features interview Q&As – Sealed Classes & Interfaces

Q01: Why do you need sealed classes when you have the final modifier? A01: The final modifier on a class doesn’t allow anyone to extend it. What if you want to extend a class, but only allow it for some classes? Java sealed classes and interfaces restrict that which classes…

Read more ...


07: Java 9 to 20 features interview Q&As – JShell & Collection factory methods

Q01: What is a JShell in Java? A01: JShell was introduced in Java 9, and it is a Read-Evaluate-Print-Loop (aka REPL). It provides an interactive shell for quickly prototyping, debugging, and learning Java and Java APIs. This can be done without the need for a public static void main or…

Read more ...


08: Java 9 to 20 features interview Q&As – Virtual Threads

Q01: What are virtual threads in Java? A01: Virtual threads in Java are analogous to goroutines in the Go language. The virtual threads are a new type of thread that tries to overcome the resource limitation problem of platform threads by storing the stack frames in the heap, which is…

Read more ...


Java Developer & Architect Q&As

Big Data Engineer & Architect Q&As

16+ Key Areas & 13+ Techs to fast-track