Which of the following authentications uses HTTPS (HTTP over SSL) to verify a user?
You work as a Software Developer for UcTech Inc. You are building a Web site that will contain study materials on the Java language. The company wants that members can access all the pages, but nonmembers have only limited access to the Web site pages. Which of the following security mechanisms will you use to accomplish the task?
Which of the following statements about data integrity of a container are true?
Each correct answer represents a complete solution. Choose two.
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 ...
}
Which of the following methods performs the authentication of subject and, if successful, associates Principals and Credentials with the authenticated Subject?
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 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?
Mark works as a Programmer for InfoTech Inc. He develops the following deployment descriptor code.
< web-app . . . . >
< display-name > A Secure Application < /display-name > < servlet >
...
< security-role-ref >
< role-name > Manager < /role-name >
< role-link > Admin < /role-link >
< /security-role-ref >
< /servlet >
< security-role >
< role-name > Programmer < /role-name >
< /security-role >
< security-role >
< role-name > Admin < /role-name >
< /security-role >
< security-role >
< role-name > Employee < /role-name >
< /security-role >
< /web-app >
Which of the following is a valid isUserInRole() method call that can be made if request is the
HttpServletRequest request?
Which of the following exceptions will be thrown if the caller does not have permission to invoke the doAsPrivileged method?
Identify whether the given statement is true or false.
" JAR files can be used while compiling but not while executing other files. "
Which of the following methods of the HttpServletResponse interface is used for URL rewriting?
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 deployment descriptor elements is used to declare the reference of a
client ' s application to an external resource?
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.
Which of the following listeners causes an object of the implementing class to be notified when it is added to or removed from a session?
Which of the following methods is used to request that any pending finalizers be run for objects eligible for garbage collection?
Which directory in JAR files is used to store package and extension configuration data?
In which of the following directories will files be searched when the classpath is specified by the syntax below.-classpath uc\JavaFiles\NewFiles;uc\ServletFiles;.;
Which of the following methods are overridden by the FileInputStream class?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following statements about a JAR file are true?
Each correct answer represents a complete solution. Choose all that apply.
Samantha works as a Software Developer for Bluetech Inc. She develops a class Warden that needs to access the Hostel class. The Hostel class is deployed in a JAR named City.JAR. What should be done so that during compilation the Warden class has access to the Hostel class?
Which of the following code fragments will compile without error?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following exceptions will be thrown if a cipher is in decryption mode but the decrypted data is not bounded by the appropriate bytes?
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.
Which of the following elements indicates which users in specified roles are permitted access to a resource collection?
Which of the following annotations specifies the roles that are allowed to invoke a particular bean method?
Which of the following exceptions is thrown to indicate that a servlet is temporarily unavailable?
Which of the following exceptions will a compiler throw when a number is divided by zero?
In which of the following locations the helper classes of a session bean class reside?
Which of the following is a mandatory sub-element of the < web-resource-collection > element of the deployment descriptor?
Which of the following JDBC interfaces is described in the statement below?
" It provides support for executing SQL statements and stored procedures. "
Which of the following data type values is returned by the System.in.read() console input function?
Mark works as a Programmer for InfoTech Inc. He develops a Web application that takes input from users. Which of the following methods can be used by the client and server to validate the users input?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following will be returned by the expression " string " instanceof String ?
Which of the following exceptions will be thrown by the getFeature() method if the feature value cannot be assigned or retrieved?
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 statements about the String, StringBuffer, and StringBuilder classes are true?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following methods causes the currently executing thread object to temporarily pause and allow other threads to execute?
Mark works as a Software Developer for ZenTech Inc. He writes the following code.
1. public class Ques0352 {
2. public static void main(String[] args) {
3. String s1= " JavaObject " ;
4. String s1= " ObjectJava " ;
5. String s2= " ObjectJava " ;
6. if(s2.equals(s1))
7. { System.out.println( " Equal " ); }
8. else
9. { System.out.println( " Unequal " ); }
10. }
11. }
Which of the following will happen to the code when he attempts to compile and run it?
Mark works as a Programmer for InfoTech Inc. He develops an application named JavaServices. He wants to declare a security constraint that will restrict everything in the com/files directory so that security role of Admin can invoke any http methods on the resources. Which of the following element declarations will be used to accomplish the task?
Which of the following exceptions will be thrown if a program fails to implement the Serializable interface?
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.
You work as a Web Deployer for UcTech Inc. You write the < security constraint > element for an application in which you write the < auth-constraint > sub-element as follows.
< auth-constraint >
< role-name > * < /role-name >
< /auth-constraint >
Who will have access to the application?
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.
Which of the following statements about exceptions in message-driven beans are true?
Each correct answer represents a complete solution. Choose two.
Mark works as a Programmer for InfoTech Inc. He develops the following security-constraint code.
< security-constraint >
< web-resource-collection >
< web-resource-name > Manager < /web-resource-name >
< url-pattern > /acme/Manager/* < /url-pattern >
< http-method > GET < /http-method >
< http-method > POST < /http-method >
< /web-resource-collection >
// < auth-constraint/ > code
< /security-constraint >
< security-constraint >
< web-resource-collection >
< web-resource-name > Manager < /web-resource-name >
< url-pattern > /acme/Manager/* < /url-pattern >
< http-method > GET < /http-method >
< http-method > POST < /http-method >
< /web-resource-collection >
// < auth-constraint/ > code
< /security-constraint >
Which of the following < auth-constraint > element declarations of the < security-constraint > will allow everybody to access the same resources?
Mark develops an application using Java language. He writes the following code snippet in the application.
public class mClass{
public static void main(String args[]){
try{
return;
}
finally{System.out.print( " Finally " );}}}
What will happen when Mark attempts to compile and execute the code snippet?
Mark works as a Programmer for InfoTech Inc. He develops the following code for a Web application named JavaSecurity Application.
< web-app . . . . >
< display-name > A JavaSecurity Application < /display-name >
< servlet >
...
< security-role-ref >
< role-name > Manager < /role-name >
< role-link > Admin < /role-link >
< /security-role-ref >
< /servlet >
< security-role >
< role-name > Programmer < /role-name >
< /security-role >
< security-role >
< role-name > Admin < /role-name >
< /security-role >
< security-role >
< role-name > Employee < /role-name >
< /security-role >
< /web-app >
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?
Which of the following statements are true about Vector and ArrayList?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following elements contains the < filter > element in the deployment descriptor?
Which of the following statements about the isUserInRole() method are true?
Each correct answer represents a complete solution. Choose all that apply.
Peter works as a Software Developer for Neon Inc. He is developing an application in Java. He declares an interface. Which of the following field declarations are valid within the body of an interface?
Each correct answer represents a complete solution. Choose three.
Which of the following statements about serialization are true?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following statements are true about the doAs() and doAsPrivileged() methods?
Each correct answer represents a complete solution. Choose all that apply.
Mark works as a Programmer for InfoTech Inc. He develops the following code snippet.
import java.util.*;
public class DemoSet{
public static void main(String[] args){
TreeSet < String > ts = new TreeSet < String > ();
ts.add( " Sunday " );
ts.add( " Friday " );
ts.add( " Wednesday " );
ts.add( " Sunday " );
ts.add( " Monday " );
Iterator it = ts.iterator();
while(it.hasNext()){
System.out.print(it.next() + " " );
}
}
}
What will be the output when he tries to execute the given code snippet?
You develop an application. Now you want to ensure that data is sent between client and server in such a way that it cannot be changed in transit. Which of the following element declarations will be specified to satisfy the requirement of the application?
Which of the following are the main basic difference between the POST and PUT request?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following statements about a filter are true?
Each correct answer represents a complete solution. Choose all that apply.
You work as a Programmer for InfoTech Inc. You develop two html pages named authenticate.jsp and error.jsp, which are deployed directly at the root of the Web application named Authentication. Which of the following deployment descriptor code declarations will be used to ensure that the error.jsp page will be displayed automatically if the client is not authenticated?
Which of the following elements of the java.util.logging package exports objects to a variety of destinations including memory, output streams, consoles, files, and sockets?
Which of the following are advantages of client-side JavaScript?
Each correct answer represents a complete solution. Choose two.
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 actions can you take to seal two packages, PackageA and PackageB, in the JAR file MyJar.jar?
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?
You work as a Software Developer for NewTech Inc. You want to configure the deployment descriptor so as to specify the error pages used in the FORM based authentication. Which of the following elements will you use to accomplish the task?
Which of the following code declarations are valid error-page declarations?
Each correct answer represents a complete solution. Choose all that apply.
Mark works as a Programmer for InfoTech Inc. He develops a Java application that uses the encryption and compression techniques. Which of the following interfaces will he use to control the serialization and deserialization processes?
Which of the following methods of the HttpServletResponse interface is used for URL rewriting?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following methods of the EJBContext interface can be called by both the BMT and CMT beans?
Each correct answer represents a complete solution. Choose all that apply.
What will be the output of the following program?
class Stringtest
{
public static void main(String args[])
{
String s= " test " ;
s.concat( " paper " );
System.out.println(s);
}
}
Which of the following methods must be implemented by each subclass of the Permission class to compare permissions?
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