Are you an expertise in computer programming languages? Do you have excellent knowledge in coding? Then computer programming is the right choice for you where you can develop as a computer programmer. wisdom jobs have gathered all the information about the course, skills required, training courses and the availability of jobs. In Computer programming a set of instructions is being given in the form of code language by which the computer can understands and complies to perform a particular task or sorting out the problem. As a Computer programmer you need to write programs that maintain and control computer networks, databases or operating systems. So, to get the job easily in multinational firms our site wisdom jobs have provided you with the computer programming job interview questions and answers that ensures you to clear the interview and land at your dream job.
Question 1. What Is Reflection?
Answer :
The process of obtaining information about assemblies and the types defined within them, and creating, invoking, and accessing type instances at run time.
Reflection provides objects that describe assemblies, modules and types. You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object and invoke its methods or access its fields and properties. If you are using attributes in your code, Reflection enables you to access them.
Reflection provides infrastructure used by language compilers to implement implicit late binding.
Reflection allows known data types to be inspected at runtime. Reflection allows the enumeration of data types in a given assembly, and the members of a given class or value type can be discovered. This is true regardless of whether the type was known or referenced at compile time. This makes reflection a useful feature for development and code management tools.
Question 2. When Reflection Is Useful?
Answer :
Reflection is useful in the following situations:
Question 3. What Is Late Binding?
Answer :
Binding is the process of locating the declaration that corresponds to a uniquely specified type. When this process occurs at run time rather than at compile time, it is called late binding.
Question 4. What Is Custom Binding?
Answer :
The common language runtime supports multiple programming languages, and the binding rules of these languages differ. In the early-bound case, code generators can completely control this binding. However, in late binding through reflection, binding must be controlled by customized binding. The Binder class provides custom control of member selection and invocation.
Using custom binding, you can load an assembly at run time, obtain information about types in that assembly, specify the type that you want, and then invoke methods or access fields or properties on that type. This technique is useful if you do not know an object's type at compile time, such as when the object type is dependent on user input.
Question 5. Which Class Has Significant Importance For Reflection?
Answer :
The System. Type class is central to reflection. The common language runtime creates the Type for a loaded type when reflection requests it. You can use a Type object's methods, fields, properties, and nested classes to find out everything about that type.
Question 6. How Do You Get Type Objects From Assemblies That Have Not Been Loaded?
Answer :
Use Assembly.GetType or Assembly.GetType to obtain Type objects from assemblies that have not been loaded, passing in the name of the type or types you want.
Question 7. How Do You Get To Type Objects From An Assembly That Is Already Loaded?
Answer :
Use Type.GetType to get the Type objects from an assembly that is already loaded Use Type. Get Type to get the Type objects from an assembly that is already loaded.
Question 8. How Do You Obtain Module Type Objects?
Answer :
Use Module.GetType and Module.GetType to obtain module Type objects.
Question 9. Which Property Is Used To Determine Whether The Type Is Generic?
Answer :
Use the IsGenericType property to determine whether the type is generic, and use the IsGenericTypeDefinition property to determine whether the type is a generic type definition.
Answer :
System.Reflection. Emit
Question 11. What Is The Use Of System.reflection Namespace?
Answer :
The System.Reflection namespace contains types that retrieve information about assemblies, modules, members, parameters, and other entities in managed code by examining their metadata. These types also can be used to manipulate instances of loaded types, for example to hook up events or to invoke methods.
Question 12. Is It Good To Use Reflection In An Application? Why?
Answer :
No, It's like challenging the design of application.
Question 13. What Is Performing Java.lang. Class Class?
Answer :
The java.lang. Class class performs mainly two tasks:
Question 14. Why Is Reflection Slower?
Answer :
Because it has to inspect the metadata in the Bytecode instead of just using pre compiled addresses and constants.
Question 15. What Is Java Reflection Api?
Answer :
Question 16. How To Get The Object Of Class Class?
Answer :
There are 3 ways to get the instance of Class class.
They are as follows:
Question 17. Determining The Class Object?
Answer :
Following methods of Class class is used to determine the class object:
Let's see the simple example of reflection api to determine the object type.
class Simple{}
interface My{}
class Test{
public static void main(String args[]){
try{
Class c=Class.forName("Simple");
System.out.println(c.is Interface());
Class c2=Class.forName("My");
System.out.println(c2.is Interface());
}catch(Exception e){System.out.println(e);}
}
}
Output:
false
true
Question 18. For Name () Method Of Class Class?
Answer :
Let's see the simple example of forName () method.
class Simple{}
class Test{
public static void main(String args[]){
Class c=Class.forName("Simple");
System.out.println(c.getName());
}
}
Output: Simple
Computer Programming Related Tutorials |
|
---|---|
Computer Fundamentals Tutorial | Computer Logical Organization Tutorial |
Computer Programming Related Practice Tests |
|
---|---|
Computer Science Engineering Practice Tests | Computer Hardware Practice Tests |
Computer Fundamentals Practice Tests | Computer architecture Practice Tests |
Computer technician Practice Tests |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.