employer cover photo
employer logo
employer logo

Just Eat Takeaway.com

Is this your company?

Just Eat Takeaway.com interview question

Write a program which will get the second highest value in a list

Interview Answer

Anonymous

Apr 27, 2021

List list=new ArrayList(); list.add("a"); list.add("b"); list.add("c"); list.add("d"); list.add("e"); list.add("f"); System.out.print("Second highest is:"+list.get(list.size()-2));