John works as a Software Developer for VenTech Inc. He writes the following code using Java.
public class vClass extends Thread
{
public static void main(String args[])
{
vClass vc=new vClass();
vc.run();
}
public void start()
{
for(int k=0;k<20;k++)
{
System.out.println("The value of k = "+k);
}
}
}
What will happen when he attempts to compile and execute the application?
Which of the following code is used to create an object of security manager?
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?
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?
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.
Martin works as a Programmer in Data Net Inc. He writes the following code.
1. class Ques0191{
2. public static void main(String[] argv){
3. byte a = 1;
4. switch(a+1){
5. case 1.
6. System.out.println("One");
7. case 2.
8. System.out.println("2");
9. case 2.
10. System.out.println("Two"); break;
11. }
12. }
13. }
What will happen when Martin attempts to compile and execute the code?
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 functions are performed by methods of the
HttpSessionActivationListener interface?
Each correct answer represents a complete solution. Choose all that apply.
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 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?