hacker rank 49th java solution(java reflection attributes)

49. JAVA REFLECTION - ATTRIBUTES



public class Solution {

        public static void main(String[] args){
            Class student = Student.class;
            Method[] methods = student.getDeclaredMethods();

            ArrayList<String> methodList = new ArrayList<>();
            for(Method i:methods){
                methodList.add(i.getName());
            }
            Collections.sort(methodList);
            for(String name: methodList){
                System.out.println(name);
            }
        }

    }


Compiler Message
Success
Expected OutputDownload
ahqym
amftc
anotherfunction
atcks
bwkbd
cfwyc
cmkxa
dnpym
dnqvo
dvvwq
ehjdm
elyed
fmyce
getEmail
getId
getName
ghtlj
hluvb
isqdf
iwhtf
{-truncated-}

Comments

Popular posts from this blog

Amazon Web Services

Google Code-In mentorship experience :)

Hacker Rank all java and python problem solutions