1.
One word should be sufficient enough to hold –
Correct Answer(s)
A. Int
C. ReturnAddress
Explanation
The given correct answer includes two options: "int" and "returnAddress". "int" is a data type in programming that is used to store integer values. "returnAddress" is a term that refers to the memory location where a program should return after executing a function or subroutine. Therefore, both "int" and "returnAddress" are valid options that can hold data in programming. The option "long" is not included in the correct answer.
2.
Which of the following run-time data areas are shared across threads?
Correct Answer(s)
A. Method Area
B. Heap
Explanation
The Method Area and Heap are the run-time data areas that are shared across threads. The Method Area stores the class structures, method code, and static variables, which are common to all threads. The Heap is used for dynamic memory allocation, and it is also shared among threads. The Java Stack, on the other hand, is not shared across threads. Each thread has its own Java Stack, which is used for storing local variables and method call information. Therefore, the correct answer is Method Area and Heap.
3.
In a memory rich JVM implementation, Method Tables would exist for –
Correct Answer
B. Concrete Classes
Explanation
In a memory rich JVM implementation, Method Tables would exist for Concrete Classes. Method tables are data structures used by the JVM to store information about methods in a class. Concrete classes are the actual implementation classes that provide specific behavior and can be instantiated, so they require method tables to store information about their methods. Interfaces and abstract classes, on the other hand, do not have concrete implementations and cannot be instantiated, so they do not have method tables.
4.
What would be the class name for a Double Dimensional Boolean array?
Correct Answer
C. [[Ljava.lang.Boolean
Explanation
The class name for a Double Dimensional Boolean array would be [[Ljava.lang.Boolean. This is because the array is a double dimensional array, indicated by the two sets of square brackets. The "L" indicates that it is a reference type, and "java.lang.Boolean" specifies the class of the elements in the array.
5.
Which of the following can be stored directly on Stack Frames?
Correct Answer(s)
B. Reference
C. Int
Explanation
In computer programming, stack frames are used to store local variables and function call information. The return address is typically stored on the stack frame to keep track of where to return after a function call. References and integers can also be directly stored on stack frames as they are simple data types that can be easily allocated and deallocated from the stack. However, short is a data type that requires more memory than a single stack frame can provide, so it cannot be directly stored on stack frames.
6.
Constants (static final variables) are stored in the method Area of –
Correct Answer
C. Both a & b
Explanation
Constants (static final variables) are stored in both the Type that declares them and the Types that use them. When a constant is declared in a class, it is stored in the memory allocated for that class. This allows other methods within the class to access the constant. Additionally, when other classes use the constant, a copy of it is stored in their respective memory allocation. This ensures that the constant can be accessed and used by multiple classes without any conflicts or dependencies on the declaring class. Therefore, the correct answer is both a and b.
7.
By default the following Class Loader(s) is/are present in any running Java application version 1.2 onwards –
Correct Answer(s)
A. BootStrap Class Loader
C. Class Path Class Loader
Explanation
The correct answer is BootStrap Class Loader and Class Path Class Loader. In any running Java application version 1.2 onwards, the BootStrap Class Loader is responsible for loading core Java classes from the bootstrap classpath. The Class Path Class Loader, on the other hand, is responsible for loading classes from the classpath specified by the CLASSPATH environment variable or the -classpath command-line option. Therefore, both of these class loaders are present in any running Java application.
8.
Which of the following are true about Class Loaders –
Correct Answer(s)
A. Guards the border of trusted Class
B. There is one namespace per ClassLoader Libraries.
C. Works in Parent Delegation model from version 1.2 onwards.
Explanation
Class Loaders guard the border of trusted Class, meaning they control the loading of classes and ensure that only trusted classes are loaded into the JVM. There is one namespace per ClassLoader Libraries, which means that classes loaded by different class loaders do not conflict with each other. Class Loaders work in the Parent Delegation model from version 1.2 onwards, which means that before loading a class, the class loader will first delegate the task to its parent class loader. The statement "Classpath Classloader is allowed to load a class java.lang.Virus" is not true as the Classpath Classloader does not have the authority to load classes from the java.lang package.
9.
Code signing & authentication mechanism allow us to have fine grained security policies.
Correct Answer
A. True
Explanation
Code signing and authentication mechanisms provide a way to verify the integrity and authenticity of software. By digitally signing code, it ensures that the code has not been tampered with and comes from a trusted source. This allows for the implementation of fine-grained security policies, as the system can validate the signatures and enforce specific access controls based on the trust level of the signer. Therefore, the statement that code signing and authentication mechanisms allow for fine-grained security policies is true.
10.
Which of the following are verified in the Pass Two of Class File Verifier?
Correct Answer(s)
A. Method Descriptors
B. Some of the Java language rules
Explanation
In the Pass Two of Class File Verifier, the method descriptors and some of the Java language rules are verified. Method descriptors provide information about the parameters and return type of a method, ensuring that they are correctly defined. The verification of some Java language rules ensures that the code follows the syntax and semantics of the Java language. These verifications help ensure the integrity and correctness of the bytecode and prevent potential runtime errors.