Sollicitatievraag bij Accenture

Store the elements in a stack and have a function that returns the minimum value without iterating again over it. Design an auto-complete mechanism similar to google's autocomplete mechanism. What are default methods in Interfaces in Java 8 , why are they needed? If a class extends two interfaces having the same default method , what will happen then How will you make an Employee class as your HashMap key.

Antwoord op sollicitatievraag

Anoniem

7 apr 2021

If a class extends two interfaces having the same default method then compiler will ask you to implement that default method in your class. To make your Employee class as part of your HashMap key override the Hashcode and Equals method and ensure that the Employee class is immutable.

1