Files

23 lines
691 B
Java
Raw Permalink Normal View History

2017-02-24 00:24:47 -06:00
// Author: Rodney Shaghoulian
2018-07-27 16:45:56 -07:00
// Github: github.com/RodneyShag
// HackerRank: hackerrank.com/RodneyShag
2017-02-24 00:24:47 -06:00
public class Solution {
public static void main(String[] args) {
Class student = Student.class; // uses class literal, not a function.
Method[] methods = student.getDeclaredMethods();
/* Get names from Methods */
ArrayList<String> methodNames = new ArrayList<>();
for (Method method : methods) {
methodNames.add(method.getName());
}
/* Sort and print names */
Collections.sort(methodNames);
for (String name: methodNames) {
System.out.println(name);
}
}
}