Mihai Surdeanu

(#11) Tricky Java Questions for Interviews

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).

Mihai

Pasionat de IT. Pasionat de viață. Pasionat de tot ceea ce înseamnă a face o viață mai bună, plină de înțelegere, ajutor reciproc și iubire de aproape.

Adaugă comentariu

Arhive

Arhiva personală