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?
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.
Which of the following options are available with jar files?
Each correct answer represents a complete solution. Choose all that apply.
Mark works as a Programmer for InfoTech Inc. He wants to develop a JMS API application that is used as a messaging service application. He writes the following createSession() method.
session = connection.createSession(false, 2);
Which of the following statements are true about the syntax?
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?
Mark works as a Programmer for InfoTech Inc. He creates a program that uses the following code.
1. class Book
2. {
3. Short f1= 15;
4. Book GetDetails(Book b1)
5. {
6. b1=null;
7. return b1;
8. }
9. public static void main(String args[])
10. {
11. Book b1 = new Book();
12. Book b2 = new Book();
13. Book b3 = b1.GetDetails(b2);
14. b1=null;
15. //code
16. }
17. }
How many objects will be eligible for garbage collection when line 15 is reached?
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.
You work as a Software Developer for UcTech Inc. You want to declare a security constraint in the deployment descriptor using the
Each correct answer represents a complete solution. Choose all that apply.
Consider the given lines of codE.
package ucert
class memberaccess
{
public int mem = 10;
}
Which of the following can directly access the variable mem?
Which of the following statements is used to enclose a block of code in which an exception is likely to occur?
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.
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 listeners causes an object of the implementing class to be notified when it is added to or removed from a session?
In which of the following locations the helper classes of a session bean class reside?
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 exceptions will be thrown by the validate method if the result type does not match the Source type, or if the specified source is neither SAXSource nor DOM Source?
Which of the following TextField constraints hides the input while a user is entering the data in the text box?
Which of the following methods throws a SecurityException if the calling thread is not allowed to open a socket connection to the specified host and port number?
Identify whether the given statement is true or false.
"When a Java program starts up, one thread begins running immediately."
Which of the following CLDC connector modes is used only for data input over a connection?
Which of the following classes enables a programmer to create an object and protect its confidentiality with a cryptographic algorithm?
There are two threads defined in an application named "thread1" and "thread2". Which of the following options can be the direct cause of "thread1" becoming blocked?
Each correct answer represents a complete solution. Choose all that apply.
You have the following code fragment of a Java program named test.
12. public void getData(){
13. ArrayList numbers=new ArrayList();
14. for(int i=0; i<10;1++){
15. int value=i*((int i) Math.random());
16. Integer obj=new Integer(value);
17. numbers.add(obj);
18. }
19. System.out.println(numbers);
20. }
On which of the following lines of code will the object referenced by obj be eligible for garbage
collection?
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.
Which of the following methods specifies which LoginModules should be used for a particular application, and in what order the LoginModules should be invoked?
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 classes is an engine class designed to provide conversions between opaque cryptographic keys and allows you to build an opaque key object from a given key specification?
Which of the following exceptions will be thrown if a program fails to implement the Serializable interface?
You work as a Software Developer for UcTech Inc. You want to ensure that a class is informed whenever an attribute is added, removed, or replaced in a session. Which of the following is the event that you will use to accomplish the task?
You work as a Software Developer for TechnoZen Inc. You create an application using Java. You define a method, named myMethod. You also define a class, named myClass, within myMethod.
Which of the following rules governs the access to the variables of the enclosing method?
The java.util.logging package provides the classes and interfaces of the Java platform's core logging facilities. Which of the following are the main target uses of logs?
Each correct answer represents a complete solution. Choose all that apply.
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?
Mark works as a Programmer for InfoTech Inc. He develops the following security-constraint code.
//
//
Which of the following
Which of the following code snippets will read the eighth byte of the file wRead.txt into the variable str?