Which of the following exceptions will be thrown by the getFeature() method if the feature value cannot be assigned or retrieved?
Which of the following methods belongs to the Refreshable interface?
You have written the following code snippet.
1. public class Read {
2. protected int ReadText(int x) { return 0; }
3. }
4. class Text extends Read {
5. /*insert code here*/
6. }
Which of the following methods, inserted independently at line 5, will compile?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following data type values is returned by the System.in.read() console input function?
Which of the following tags is used to include resources from within the same servlet container?
Which of the following exceptions is thrown to indicate that a servlet is temporarily unavailable?
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 is the return type of the getInitParameter() method of the ServletContext interface?
In which of the following locations the helper classes of a session bean class reside?
Which of the following exceptions will be thrown if the commit() method fails?
Which of the following classes of java.util.logging prints a brief summary of the LogRecord in a human readable format?
You work as a developer for PassGuide Inc. You have implemented a session bean with a method doPrint(), which behaves differently depending on the caller's security role. Only MANAGER in the security roles "ADMIN" and "MANAGER" are allowed to call the method. Which of the following actions are appropriate to accomplish if there is no security-related metadata in the deployment descriptor?
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?
Which of the following statements can be used by a Programmer to suggest the JVM to perform garbage collection?
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.
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?
You work as a Programmer for InfoTech Inc. You write the following code.
1. public class InnerDemo{
2. public static void main(String[] args) {
3. Car c = new Car();
4. // insert code here
5. e.test();
6. }
7. }
8. class Car{
9. class Engine{
10. void test() {System.out.println("test"); }
11. }
12. }
Which of the following options should you add to line 4 so that the code compiles and produces the output "test"?
Which of the following deployment descriptor elements must contain the
Which of the following methods is used to encrypt or decrypt data in a single step?
You work as a Software Developer for BlueTech Inc. You create code using EJB 3.0. You want to ensure that each new record is checked for validation before it is inserted into the database. Which of the following callback methods will you use to write the logic for validation?
Which of the following classes is an engine class that provides an opaque representation of cryptographic parameters?
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?
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 statements about the isCallerInRole() method are true?
Each correct answer represents a complete solution. Choose all that apply.
You have created a Java application that will retrieve and insert data into a database table. Which of the following objects will you use to pass the JDBC Driver to obtain a connection to the database server?
Which of the following statements correctly describe the features of the singleton pattern?
Each correct answer represents a complete solution. Choose all that apply.
Mark works as a Programmer for InfoTech Inc. He develops a Website that uses HTML and processes HTML validation. Which of the following are the advantages of the HTML application?
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?
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 methods are used to customize object serialization so that the objects will be able to apply default serialization?
Each correct answer represents a complete solution. Choose two.
You work as a Software Developer for BlueWell Inc. Your team creates a Web site for online shopping.
All payments are made through credit cards. Hence, you want to ensure that the information transferred between the customers and your Web site is encrypted. Which of the following authentication 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.
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?
You work as a programmer for PassGuide.Inc. You want to create a servlet filter that stores all request headers to a database for all requests to the Web application's home page "/work.jsp". Which of the following HttpServletRequest methods allows you to retrieve all of the request headers?
You work as a Web Deployer for UcTech Inc. You write the
Who will have access to the application?
Which of the following circumstances can prevent the execution of code in a finally block?
Each correct answer represents a complete solution. Choose two.
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
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?
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 pieces of codes will be placed at the line XXX to successfully compile the given class?
public interface Publication
{
String GetDetails();
}
public class Book implements Publication
{
//line XXX
}
Which of the following statements about the form-based authentication are true?
Each correct answer represents a complete solution. Choose two.
Given the following directory structure.
Assuming that the current directory is com, which of the below options can be used to create a jar file called TestJar.jar that contains all the files from the directory testApp?