Which of the following statements are true?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following methods performs the authentication of subject and, if successful, associates Principals and Credentials with the authenticated Subject?
What will be the output of the following code snippet?
class test22
{
public static void main(String args[])
{
String str= new String("Hello");
str.insert(3,"bye");
System.out.println(str);
}
}
Which of the following is a mandatory sub-element of the
Which of the following exceptions is thrown if a class uses the clone() method but does not implement the Cloneable interface?
Which of the following are correct if LoginContext enforces the requisite flag to each LoginModule in the configuration file?
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 methods can be invoked by a message-driven bean?
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?
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 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?
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?
Mark works as a Programmer for InfoTech Inc. He develops the following program.
class iftest2
{public static void main(String args[])
{int x=0, y=1;if //code//{System.out.println("true");}}}
Which of the following if statements are illegal if they are placed at //code//?
Which of the following methods are used in the verification of a signature?
Each correct answer represents a complete solution. Choose all that apply.
Which of the following elements contains the
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?
Roger works as a Software Developer for Tech Mart Inc. He creates an application using Enterprise JavaBeans. In the bean class, he writes a code snippet as follows.
Boolean b = ctx.isCallerInRole("Administrator");
The application assembler named Bob declares the following entries within the
1.
2. The HR-Manager will have permission to access all the methods.
3.
4.
5.
Bob wants to ensure that HR-Manager declared in the deployment descriptor should have all the privileges of an administrator. Which of the following elements should Bob declare in line 4 while deploying the bean?
Which of the following statements are true about Vector and ArrayList?
Each correct answer represents a complete solution. Choose all that apply.
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.
Which of the following methods is used by the AccessController to determine whether or not a requested permission is used by another permission that is known to be valid in the current execution context?
Identify whether the given statement is true or false.
"When a Java program starts up, one thread begins running immediately."
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 methods causes the currently executing thread object to temporarily pause and allow other threads to execute?
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?
Which of the following deployment descriptor elements is used to declare the reference of a
client's application to an external resource?
According to the EJB programming restrictions, which of the following should be used to access the files or directories?
Which of the following statements can be used by a Programmer to suggest the JVM to perform garbage collection?
Which of the following is used to restore the objects that have been previously serialized by a stream?
Which of the following statements are true about object serialization?
Each correct answer represents a complete solution. Choose all that apply.
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?
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 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.
Which of the following statements about programmatic security are true?
Each correct answer represents a complete solution. Choose all that apply.
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.
Mark writes a class Practice.java. This class needs to access the com.bar.Test class that is stored in the Test.jar file in the directory /practice. How would you compile your code?