You work as a programmer for PassGuide.Inc. You have a session object named session1 with an attribute named Attribute1, and an HttpSessionBindingEvent object binding1 bound to session1. Which of the following will be used to retrieve Attribute1? Each correct answer represents a complete solution. Choose all that apply.
A. Object obj=binding1.getSession().getAttribute("Attribute1");
B. Object obj=binding1.getAttribute("Attribute1");
C. Long MyAttribute=session1.getAttribute("Attribute1");
D. String str1=session1.getAttribute("Attribute1");
E. Object obj=session1.getAttribute("Attribute1");
Which of the following methods are overridden by the FileInputStream class? Each correct answer represents a complete solution. Choose all that apply.
A. void reset()
B. void write(int b)
C. void flush()
D. long skip(long numBytes)
Which of the following web-resource element descriptions will be used if you want to restrict all URL's in the application and perform authentication for the http delete method?
A.
B.
C.
D.
Mark works as a Programmer for InfoTech Inc. He develops the following security-constraint code.
//
//
Which of the following
everybody to access the same resources?
A. Place the following code in the second
B. Place the following code in the first
C. Place the following code in the first
D. Place the following code in the first
Mark works as a Programmer for InfoTech Inc. He develops a program that defines a class named
Inventory that has an instance variable named NumOfItems. Which of the following properties will be
applied by NumOfItems?
Each correct answer represents a complete solution. Choose all that apply.
A. It will not be visible in Static methods if it passed as a parameter.
B. It will be visible in Static methods if it passed as a parameter.
C. It will be available for all the instance methods of the class.
D. It becomes available for garbage collection if it is no longer in scope.
Which of the following is a Permission class whose permissions have no actions, and allows suppressing the standard Java programming language access checks?
A. java.awt.RuntimePermission
B. java.security.SecurityPermission
C. java.lang.reflect.ReflectPermission
D. java.lang.AllPermission
Which of the following statements are true about the doAs() and doAsPrivileged() methods? Each correct answer represents a complete solution. Choose all that apply.
A. The doAsPrivileged() method invokes AccessController.doPrivileged by passing it the provided PrivilegedAction.
B. The doAs() and doAsPrivileged() methods perform privileged work as a particular Subject.
C. The doAs() method retrieves the current Thread's AccessControlContext viaAccessController.getContext.
D. The doAsPrivileged() method, instead of retrieving the current Thread's AccessControlContext, uses the provided AccessControlContext.
You work as a Software Developer for NewTech Inc. You write a bean class called EmployeeBean. The class contains two methods, EmpSal() and EmpAttendance(). Both these methods can be accessed by the ADMIN role. The EmpSal() method can be accessed only by the HR role, while the EmpAttendance () method can be accessed only by the DBA role. You want the EmpAttendance() method to be accessed by the HR role also. However, no other roles in the class except ADMIN, DBA, and HR should be able to access the EmpAttendance() method. Which of the following steps will you take to accomplish the task? Each correct answer represents a complete solution. Choose all that apply.
A. Use the
B. Use the @RunAs("ADMIN") annotation to allow the HR the privileges as ADMIN.
C. Use the @RunAs("DBA") annotation to allow the HR the privileges as DBA.
D. Use the
E. Use the @PermitAll annotation with the EmpAttendance() method to allow the HR to access the EmpAttendance() method.
Which of the following permission classes is an abstract class ancestor of all permissions and defines the essential functionalities required for all permissions?
A. java.security.Permissions
B. java.security.PermissionCollection
C. java.security.UnresolvedPermission
D. java.security.Permission
Maria works as a Software Developer for Bluetech Inc. She develops a class named Warden that needs to access a class named Hostel, which is deployed in a JAR named City.JAR. What will she do in order to enable the Warden class to have access to the Hostel class during compilation?
A. She will place the JAR file in javaprog/City.JAR and set the class path environment to include javaprog/ City.JAR/Warden.class.
B. She will place the JAR file in javaprog/City.JAR and set the class path environment to include javaprog/ City.JAR/Hostel.class.
C. She will place the JAR file in $ JAVA_HOME/jre/lib/ext/City.JAR.
D. She will place the JAR file in $ JAVA_HOME/jre/classes/City.JAR.