Java - Interview Questions and Answers for 'Reflection' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2098 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Reflection' - 5 question(s) found - Order By Newest

 Q1. What is reflection ?
Anonymous
Ans. It is the process of examining / modifying the behaviour of an object at runtime.

  Sample Code for reflection

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   reflection   reflection api   ebay   mindtree      basic        frequent


 Q2. How can we test methods individually which are not visible or declared private ?
admin
info@buggybread.com
Ans. We can either increase their visibility and mark them with annotation @VisibleForTesting or can use reflection to individually test those methods.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     junit   reflection api   @visiblefortesting   white box tester


 Q3. Is It Good to use Reflection in an application ? Why ?Core Java
Admin
info@buggybread.com
Ans. no, It's like challenging the design of application.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   reflection api   yes-no   architecture     Overstock.com      intermediate


 Q4. Why is Reflection slower ?
Admin
info@buggybread.com
Ans. Because it has to inspect the metadata in the bytecode instead of just using precompiled addresses and constants.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   reflection   reflection api   architecture


 Q5. What is the use of MethodHandle ?

Ans. MethodHandle is a modern, more flexible, more typesafe way of doing reflection.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     MethodHandle  Reflection




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: