Which of the following statements about a JAR file are true?
Each correct answer represents a complete solution. Choose all that apply.
Identify whether the given statement is true or false.
"When an exception occurs in a try block, each catch statement following the try block is inspected in sequential order, and the last one whose type matches that type of exception is executed."
Which of the following fields must be present in the login page when using the form-based authentication?
Each correct answer represents a part of the solution. Choose two.
Which of the following will be returned by the expression "string" instanceof String?
Which of the following is the valid permission for a BasicPermission?
Which of the following statements are true?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following exceptions will be thrown if the name parameter is null in the constructor of AuthPermission?
Consider the given lines of codE.
package ucert
class memberaccess
{
public int mem = 10;
}
Which of the following can directly access the variable mem?
Identify whether the given statement is true or false.
"An object becomes eligible for garbage collection when it becomes unreachable by any code."
Which of the following JAR file options creates and includes a manifest file?
Which of the following statements are true?
Each correct answer represents a complete solution. Choose all that apply.
The following JSP scriptlet is given.
<% response.setContentType("text/html; charset=ISO-8859-1"); %>
Which of the following directives is the equivalent directive for the scriptlet given above?
You work as a Software Developer for UcTech Inc. You create a session using the HttpSession interface. You want the attributes to be informed when the session is moved from one JVM to another and also when an attribute is added or removed from the session. Which of the following interfaces can you use to accomplish the task?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following CLDC connector modes is used only for data input over a connection?
Which of the following mechanisms is closely related to authorization?
Which of the following statements are true?
Each correct answer represents a complete solution. Choose all that apply.
Mark works as a Programmer for InfoTech Inc. He develops a class named Data that imports all the required packages. The class Data uses a method named PrintData(), which uses a method that checks whether the caller has a BeanUser security role. Which of the following code of the method PrintData() will satisfy the requirement?
Which of the following classes is an engine class that provides an opaque representation of cryptographic parameters?
You work as a Software Developer for NewTech Inc. You write a bean class using Enterprise
JavaBeans 3.0. The class uses the @DeclareRoles ("ADMIN, HR, DBA, USER") annotation to declare the security roles. The class contains a method named showResult(). You want to ensure that the ADMIN role is granted privilege to the showResult() method. Moreover, if a role that is not allowed to access the method tries to call the method, an error message must be shown. Assuming that there is no security-related element in the deployment descriptor, which of the following will you use to accomplish the task?
Each correct answer represents a part of the solution. Choose two.
Given a code of a class named PrintString that prints a string.
1. public class PrintString{
2. public static void main(String args[]){
3. /*insert code here */
4. /* insert code here */
5. System.out.println(str);
6. }
7. }
Which of the following code fragments can be inserted in the class PrintString to print the output "4247"?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following are advantages of client-side JavaScript?
Each correct answer represents a complete solution. Choose two.
Which of the following methods is used to authenticate the users, and if the user has not been authenticated, the method returns false?
You work as a Programmer for InfoTech Inc and develop the following two
declarations.
Which of the following statements is true about the
Which of the following is used to restore the objects that have been previously serialized by a stream?
Which of the following statements about programmatic security are true?
Each correct answer represents a complete solution. Choose all that apply.
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 ...
}
Dennis works as a Programmer in Broadnet Inc. He writes the following program.
1. public class Ques0307{
2. public static void main(String[] argv){
3. int arr[] = {1, 2, 3, 4};
4. try{
5. int k = 0;
6. for(; k < 4; k++)
7. arr[k] = arr[k] + 1;
8. System.out.println("try");
9. }
10. catch(ArrayIndexOutOfBoundsException a){
11. System.out.println("index " +k +" not found");
12. }
13. catch(Exception e){
14. System.out.println("catch1");
15. }
16. finally{
17. System.out.println("finally");
18. }
19. }
20. }
What will happen when Dennis attempts to compile and execute the program?
Given below are top-level class declarations. Which of these class declarations would not produce a compile-time error?
abstract class P {} //1
private class Q {} //2
static class R {} //3
transient class S {} //4
Which of the following init() method calls initializes a cipher object with a key in the SECRET_MODE?
Which of the following permission classes is an abstract class ancestor of all permissions and defines the essential functionalities required for all permissions?
Mark works as a Programmer for InfoTech Inc. He creates a method named roomBooking() and this method throws IndexOutOfBoundsException. Which of the following roles will automatically handle the exception?
Which of the following statements about exceptions in message-driven beans are true?
Each correct answer represents a complete solution. Choose two.
You work as a Software Developer for Developer Inc. You write the following code.
interface A {public boolean b = false;}
class C implements A {public static void main(String args[]) {b = true;System.out.println(b);}}
Which of the following will be the result, when you try to compile and execute the above code?
Mark works as a Programmer for InfoTech Inc. He develops an application named AccountServlet. He wants to ensure that no body can access his application, i.e., he does not want any role to have access on his application. He defines the following security constraint for his application.
//code
Which of the following options will be used to secure his application?
Mark works as a Programmer for InfoTech Inc. He develops the following code for a Web application named JavaSecurity Application.
...
Which of the following will be the action of the container if the request is HttpServletRequest, and request.isUserInRole("Admin"); has been called in a servlet code?
Mark works as a Programmer for InfoTech Inc. He develops a code snippet for a class named
servletClassA that extends the HttpServlet class. Which of the following HttpServlet class methods are not required to be overridden by the servletClassA?
Each correct answer represents a complete solution. Choose all that apply.
Mark works as a Programmer for InfoNet Inc. He writes the following programs.
1. package book;
2. public class read
3. {
4. (access modifier) int r1=10;
5. }
1. package book1;
2. import book.read;
3. class Doread extends read
4. {
5. public void test()
6. {
7. System.out.println("The value of r1 is." +r1);
8. }
9. }
Which of the following access modifiers will be put in the place of the word, (access modifier), to compile the program successfully?
Which of the following conditions must be satisfied before the HTTP client authentication mechanism is used?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following statements about ServletContext attributes is true?
Rachel works as a Software Developer for Vivanet Inc. She writes the following code using Java.
class catchexcp
{public static void metha()
{int x=4/0;System.out.print("Caught exception");}
public static void main(String args[])
{try{metha();}catch(ArithmeticException ae){System.out.print("Caught ArithmeticException");}finally{try{metha();}catch(ArithmeticException ae){System.out.print("ReCaught ArithmeticException");}}}}
What will happen when she tries to compile and execute the code?
You have the following code of a PreparedStatement.
PreparedStatement stm = con.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?");
Which of the following statements are true about a PreparedStatement?
Each correct answer represents a complete solution. Choose all that apply.