Which of the following classes is an engine class that provides an opaque representation of cryptographic parameters?
A. DSAPublicKeySpec
B. AlgorithmParameterGenerator
C. DSAParameterSpec
D. AlgorithmParameters
Which of the following statements about the String, StringBuffer, and StringBuilder classes are true? Each correct answer represents a complete solution. Choose all that apply.
A. The StringBuffer class offers faster performance than the StringBuilder class.
B. The StringBuffer class is thread-safe while the StringBuilder class is not.
C. A character in a string can be searched using the indexOf() operator.
D. The return type of the trim() method present in the String class is void.
Which of the following is the appropriate deployment descriptor elements entry for the code given below?
@RunAs("admin")
@Stateless public class StudentBean implements Student { //more code ...
}
A.
B.
C.
D.
Which of the following statements are true?
Each correct answer represents a complete solution. Choose all that apply.
A. StringBuffer is thread safe, but StringBuilder is not.
B. The String class is final.
C. StringBuilder offers faster performance than StringBuffer.
D. The size of the String can be obtained using the length property.
You write the following code.
class Father {public void Method() {System.out.println("I am Father");}} public class Son extends Father
{public static void main(String argv[]) {Son son = new Son();son.Method();}
private void Method() {System.out.println("I am Son");}} Which of the following will be the result, when you
try to compile and run the code?
A. I am Father will be displayed as the output.
B. A runtime error will result.
C. I am Son will be displayed as the output.
D. The code will execute but without displaying any output.
E. A compile-time error will result.
Which of the following are valid class declarations?
Each correct answer represents a complete solution. Choose all that apply.
A. public abstract final Ques0160c
B. public abstract class Ques0160a
C. final public class Ques0160b
D. native synchronized class Ques0160d
Which of the following are valid method signatures of the getInstance() method of the Policy class? Each correct answer represents a complete solution. Choose all that apply.
A. getInstance(ProtectionDomain domain)
B. static Policy getInstance(String type, Policy.Parameters params, Provider provider)
C. getInstance(String type, Policy.Parameters params)
D. static Policy getInstance(String type, Policy.Parameters params, String provider)
Roger works as a Software Developer for Tech Mart Inc. He creates an application using Enterprise
JavaBeans. In the bean class, he writes a code snippet as follows.
Boolean b = ctx.isCallerInRole("Administrator");
The Application Assembler named Bob declares the following entries within the
deployment descriptor.
1.
2.
The HR-Manager will have permission to access all the methods.
3.
4.
5.
Bob wants to ensure that the HR-Manager declared in the deployment descriptor has all the privileges of
an administrator. Which of the following elements should Bob declare in line 4 while deploying the bean?
A.
B.
C.
D.
Which of the following data type values is returned by the System.in.read() console input function?
A. String
B. Integer
C. Float
D. Character
Which of the following methods evaluates the global policy for the permissions granted to the ProtectionDomain and tests whether the permission is granted?
A. implies
B. getPolicy
C. isPolicy
D. getType