Java Test v3
1 <libraryPrefix:handlerName parameterNAme="value"> 2 <%=23*counter %> 3 <b>Congratulations!</b> Which of the following is the correct way to complete the code snippet above?
As part of the type erasure process, when compiling a class or interface that extends a parameterized class or implements a parameterized interface, the compiler may need to create a synthetic meth...
Assuming that val has been defined as an int for the code below, which values of val will result in "Test C" being printed? if( val > 4 ) { System.out.println("Test A"); } else if( val > 9 ) { ...
Assuming the servlet method for handling HTTPGET requests is doGet(HttpServletRequest req, HTTPServletResponse res), how can the request parameter in that servlet be retrieved?
Choose all valid forms of the argument list for the FileOutputStream constructor shown below:
Consider the following code: public class Jam { public void apple(int i, String s) { } //ABC } Choose possible valid code replacements of "//ABC" among the choices:
Consider the following code: public static void main(String bicycle[]) { System.out.println(bicycle[0]); } What would be the result if "java TwoTyre one two" is entered in the command line?
Conventionally, which directory do servlet class files get placed on?
How does the set collection deal with duplicate elements?
How many objects are created by the following code? Object a, b, c, d, e; e = new Object (); b = a = e; e = new Object ();
How many objects are created in the given code? Object x, y, z; x = new Object(); y = new Object()
How many objects are created in the given code? Object x, y, z; x = new Object(); y = new Object();
In which class is the notify method defined?
JDBC is based on:
RMI allows remote communication between:
Select all correct statements:
Select all true statements:
SQLException has a feature of chaining - identify the right code to execute the same from the following options:
The following code was written to save a handle to an EJBObject named 'bookEJBObject' for an online book shop: javax.ejb.Handle bookHandle = _____________; ObjectOutputStream stream = new ObjectO...
The JDK comes with a special program that generates skeleton and stub objects that is known as:
The principal finder method that must be implemented by every entity bean class is:
The transaction attribute of a bean is set to 'TX_REQUIRES_NEW.' What can be inferred about its behavior?
There are three classes named A, B, and C. The class B is derived from class A and class C is derived from B. Which of the following relations are correct for the given classes?
What exception is thrown by this code, if arr[j]>arr[j+1]: public static void main(String[] args) { int []arr={12,23,43,34,3,6,7,1,9,6}; { int temp; for ...
What is the output of the given code? public class Test15 { public static void main(String[] args) { VO a = new VO(2); VO b = new VO(3); swa...
What is the output of the given console application? public class Test19 { public static void main(String[] args) { final int X = 9; int[][] a = {{5, 4, 3},...
What is the output of the given console application? public class Test31 { public static void main(String[] args) { test(); } public static void test() { ...
What is the output of the given program? public class Test106 { public static void main(String[] args) { Integer x = 0; Integer y = 0; Integ...
What is the output of the given program? public class Test118 extends _Test118 { { System.out.print("_INIT"); } static { System.out.print("_...
What is the output of the given program? public class Test120 extends _Test120 { { System.out.print("_INIT"); } static { System.out.print("_...
What is the output of the given program? public class Test129 { public static void main(String[] args) { A a = new A2(); B b = new B2(); Sys...
What is the output of the given program? public class Test130 { public static void main(String[] args) { A a = new A2(); B b = new B2(); Sys...
What is the output of the given program? public class Test89 { public static void main(String[] args) { T x = new T(""X"", null); x.start(); T y = new T(""Y...
What is the output of the given program? public class Test89 { public static void main(String[] args) { T x = new T("X", null); x.start(); T y = new T("Y", ...
What is the output of the given program? public class Test93 { private int x = 0; public static void main(String[] args) { new Test93().test(); } ...
What is the output of the given program? public class Test97 { public static void main(String[] args) { int[][] a = new int[2][2]; System.out.println(a.leng...
What is the result of an attempt to compile and run the given program? public class Test107 { public static void main(String[] args) { System.out.println(test()); }...
What is the term to describe a situation where two or more threads are blocked forever, waiting for each other?
What protocol is used by the DatagramSocket class?
What should be the replacement of "//ABC" in the following code? class Krit { String str= new String("OOPS !!! JAVA"); public void KritMethod(final int iArgs) { int iOne; c...
What will be the output of the following code? public class MyTest { public static void main(String[] args) { for (int i=0; i > 10; i+=2) { System.out.println(i); }...
What will be the output of this program? public class Test { public static void main(String args[]) { int a, b; a = 2; b = 0; System.out.println(g(a, new int[] { b })); } public stat...
What will be the output when this code is compiled and run? public class Test { public Test() { Bar b = new Bar(); Bar b1 = new Bar(); update(b); update(b1); b1 = b; update(b); up...
What will be the output when this code is compiled and run? public class Test { public Test() { Bar b = new Bar(); Bar b1 = new Bar(); update(b); update(b1); ...
What will be the output, if the following program is run? public class Test8 { public static void main(String[] args) { System.out.println(Math.sqrt(-4)); } }
What would be the result of compiling and running the following code class? public class Test { public static void main(String args[]) { Test t = new Test(); t.start(); } public void sta...
What would happen on trying to compile and run the following code? class House { public final void MaintainMethod() { System.out.println("MaintainMethod"); } } public class Building extends...
Which class contains a method to create a directory?
Which design pattern reduces network traffic by acting as a caching proxy of a remote object?
Which distributed object technology is most appropriate for systems that consist entirely of Java objects?
Which distributed object technology is most appropriate for systems that consist of objects written in different languages and that execute on different operating system platforms?
Which exception must a setter of a constrained JavaBean property throw to prevent the property value from changing?
Which is a proper way to declare and throw exception of class XYException?
Which method in the HttpServlet class corresponds to the HTTPPUT method?
Which method is called by the servlet container just after the servlet is removed from service?
Which of the following are the methods of the Thread class?
Which of the following are valid ways to define a thread in Java?
Which of the following cannot apply to constructors?
Which of the following code snippets will generate five random numbers between 0 and 200?
Which of the following code snippets will take transform input string "2012/06/05" to output string "05 - 06 - 2012"?
Which of the following illustrates correct synchronization syntax?
Which of the following interfaces makes it possible for Java to save an object to a file and turn it into a data stream?
Which of the following is a well-known HTTP port?
Which of the following is false?
Which of the following is the correct syntax for creating a Session object?
Which of the following is the correct syntax for suggesting that the JVM perform garbage collection?
Which of the following is the name of the cookie used by Servlet Containers to maintain session information?
Which of the following JDBC methods is used to retrieve large binary objects?
Which of the following methods are members of the Vector class and allow you to input a new element?
Which of the following methods can be used for reporting a warning on a Connection object, Statement object & ResultSet object?
Which of the following methods should be invoked by the container to get a bean back to its working state?
Which of the following require explicit try/catch exception handling by the programmer?
Which of the following statements is true of the HashMap class?
Which of the following statements is true?
Which of the following statements regarding abstract classes are true?
Which of the following symbols are metacharacters supported by the java.util.regex API?
Which of the following transaction modes are supported by Enterprise Java Beans?
Which of these interfaces are used by implementations of models for JTable?
Which of these interfaces is the most applicable when creating a class that associates a set of keys with a set of values?
Which of these is not an event listener adapter defined in the java.awt.event package?
Which option could be used to see additional warnings about code that mixes legacy code with code that uses generics?
Which option lists Java access modifiers in the right order from the most permissive to the most restrictive?
Which sequence will be printed when the following program is run? import java.util.*; public class Test { public static void main(String str[]) { List l = new ArrayList(); l.add(''1''); ...
Which statement is true about the given code? public class Test78 { public static void main(String[] args) throws Exception { new JBean().setHeight(1).setWidth(2).setDepth(...
Which statement is true regarding ServletContext Initialization Parameters in the deployment descriptor?
Which statements are true regarding ServletContext Init Parameters in the deployment descriptor?
Which statements are true? Select all true statements.
Why can't a Graphics object be created using the following statement? Graphics g = new Graphics();
With regard to the destroy lifecycle method, identify the correct statements about its purpose or about how and when it is invoked.
X.509 version 3 specifies which of the following?