Mihai Surdeanu

(#3) Tricky Java Questions for Interviews

Q1: Enumerate all advantages of immutable classes compared with mutable ones.

Q2: What’s printed to console when main method is called?

public static void main(String[] args) {
    Pattern myPattern = Pattern.compile("Dummy");
    System.out.println(myPattern.matcher("This is a dummy text").matches());
}

Can you please change method implementation for printing true, instead of false?

Q3: Enumerate all differences between a minor and a major garbage collection process. What happens during a full garbage collection process?

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ă