Elance Exams Answers PDF file

-- PDF FILE --
Download PDF file of elance Zoho Creator Exam Answers
elance-zoho-creator-exam.pdf

Given following code, what will be the output: import java.lang.reflect.Method; class Bar { private int bar(int a) { return a * a; } } public class Foo { public static void main(String[] args) { try { Bar bar = new Bar(); Method method = bar.getClass().getDeclaredMethod("bar", int.class); method.setAccessible(true); System.out.println(method.invoke(bar, new Integer(5))); } catch (Exception e) { e.printStackTrace(); System.out.println("Error"); } } }

25
Null
IllegalAccessException will be thrown
CompileError
5
Top
  • Follows us our servcies
  • Facebook icon
  • Linkedin icon
  • twitter icon
  • rss icon
  • social icon