I'm pretty sure, that the answer is LinkedList, but I have no clue hot to get that class name by using getDeclaredClasses. I would appreciate any tip.
package com.codegym.task.task36.task3602;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/*
Find the class by its description
*/
public class Solution {
public static void main(String[] args) {
System.out.println(getExpectedClass());
System.out.println("****");
for(Class clazz : List.class.getDeclaredClasses()){
System.out.println(clazz);
}
System.out.println("DEC: "+ LinkedList.class.getDeclaringClass());
}
public static Class getExpectedClass() {
return Collections.class.getDeclaredClasses()[0];
}
}