Closed biryu2205 closed 6 years ago
class Solution { public static void main(String[] args) { Class student = Student.class; Method[] methods = student.getDeclaredMethods(); ArrayList<String> methodList = new ArrayList<>(); for (Method method : methods) { methodList.add(method.getName()); } Collections.sort(methodList); for (String name : methodList) { System.out.println(name); } } }
Link : - https://www.hackerrank.com/challenges/java-reflection-attributes/problem
Link : - https://www.hackerrank.com/challenges/java-reflection-attributes/problem