Goldman Sachs Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

Java reflection supports dynamic retrieval of information about classes and data structures by name, and allows for their manipulation within an executing Java program.

- jango September 13, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Reflection is commonly used by programs which require the ability to examine or modify the runtime behavior of applications running in the Java virtual machine. It gives Java classes the ability to perform dynamic introspection: the ability to look inside classes that are already loaded.
Reflection API consists of two components: objects that represent the various parts of a class file, and a means for extracting those objects in a safe and secure way.

The first component of the Reflection API is the mechanism used to fetch information about a class. This mechanism is built into the class named Class. The special class Class is the universal type for the meta information that describes objects within the Java system. Class loaders in the Java system return objects of type Class. Up until now the three most interesting methods in this class were:

forName, which would load a class of a given name, using the current class loader

getName, which would return the name of the class as a String object,which was useful for identifying object references by their class name

newInstance, which would invoke the null constructor on the class (if it exists) and return you an object instance of that class of object


To these three useful methods the Reflection API adds some additional methods to class Class. These are as follows:

getConstructor, getConstructors, getDeclaredConstructor
getMethod, getMethods, getDeclaredMethods
getField, getFields, getDeclaredFields
getSuperclass
getInterfaces
getDeclaredClasses

- Mridul March 09, 2012 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More