Tricky Java Interview Questions Series: Release 2

Photo by Maranda Vandergriff on Unsplash
List<Integer> list = new ArrayList<>(10);
List<Integer> list = new ArrayList<>();
class Parent {
private void doSomething() throws FileNotFoundException {}
}
class Child extends Parent {
private void doSomething() throws IOException {}
}
list.stream().filter(i -> Collections.frequency(list,i) > 1).collect(Collectors.toSet)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhijit Jadhav

Abhijit Jadhav

297 Followers

Full Stack Java Developer and AI Enthusiast loves to build scalable application with latest tech stack