Hero Image
- Mihai Surdeanu

(#11) Tricky Java Questions for Interviews

Motto: Bring Spring to next level...

Q1: What is escape analysis in Java and how this optimization technique helps to reduce memory footprint?

Q2: A class implements AutoCloseable. It’s possible to use an instance of this class in a try-with-resources (feature introduced in Java 7) ?

Q3: Let’s say one method receives one parameter – a String. Why is better from coding style perspective to put final to this input parameter?

Hint: Think about how objects are passed as parameters in Java (by reference or by value).

Other Related Posts:

Microbenchmarking with Java

Microbenchmarking with Java

Hello guys,

Today, we are going to continue the series of articles about Java ecosystem. More specific, today, we are going to talk about JMH (Java Microbenchmark Harness).

2nd Apr 2022 - Mihai Surdeanu