Design - Interview Questions and Answers for 'Reflection' - 7 question(s) found - Order By Newest Q1. What is reflection ?
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 Asked in 29 Companies basic   frequent Q2. How can we test methods individually which are not visible or declared private ?
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
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 Asked in 1 Companies intermediate Q4. Why is Reflection slower ?
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 Q6. How Reflection can break any design pattern ? Design
Ans. Using java reflection api, we can tweak into a class and modify it's runtime behavior and hence modify the pattern it might be using. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  reflection Q7. Can you tell us a use case of reflection in java that you have applied ? Design
This question was recently asked at 'CenturyLink'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  reflection Asked in 1 Companies