1. Question: Which of the following symbols are metacharacters supported by the java.util.regex API?

    A
    .

    B
    \

    C
    @

    D
    #

    Note: Not available
    1. Report
  2. Question: SQLException has a feature of chaining - identify the right code to execute the same from the following options:

    A
    catch(SQLException e) { out.println(e.getMessage()); while((e=e.getNextException())!=null) { out.println(e.getMessage()); } }

    B
    catch(SQLException e) { out.println(e.getNextException()); while((e=e.getMessage())!=null) { out.println(e.getMessage()); } }

    C
    catch(SQLException e) { out.println(e.getMessage()); while((e=e.getEncapsulatedException())!=null) { out.println(e.getMessage()); } }

    D
    catch(ClassNotFoundException e) { out.println(e.getMessage()); while((e=e.getNextException())!=null) { out.println(e.getMessage()); } }

    E
    catch(ClassNotFoundException e){ { out.println(e.getMessage()); } }

    Note: Not available
    1. Report
  3. Question: 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());
            }
            private static int test() {
                    return (true ? null : 0); 
            }
    }

    A
    It gets a compiler error, because of an attempt to return null from the method with return type "int".

    B
    It compiles, but throws NullPointerException at run-time.

    C
    It compiles, runs, and prints "null" (without quotes).

    D
    It compiles, runs, and prints "0" (without quotes).

    Note: Not available
    1. Report
  4. Question: Which statements are true regarding ServletContext Init Parameters in the deployment descriptor?

    A
    They are set at deployment-time, but accessed at run-time.

    B
    They are accessible from any session within that context.

    C
    They are not set at deployment-time, but accessed at run-time.

    D
    They are set at deployment-time and can be updated at run-time.

    Note: Not available
    1. Report
  5. Question: Which of the following methods are members of the Vector class and allow you to input a new element?

    A
    addItem

    B
    append

    C
    insert

    D
    addElement

    Note: Not available
    1. Report
  6. Question: In which class is the notify method defined?

    A
    Thread

    B
    Applet

    C
    Runnable

    D
    Object

    Note: Not available
    1. Report
  7. Question: What is the output of the given program?
    public class Test93 {
            private int x = 0;
    
            public static void main(String[] args) {
                    new Test93().test();
            }
    
            private int f(int x) { return ++x; }
            private int g(int y) { return x++; }
    
            private void test() {
                    System.out.print( f(x)==f(x) ? "f" : "#" );
                    System.out.print( g(x)==g(x) ? "g" : "#" );
            }
    }

    A
    ##

    B
    #g

    C
    f#

    D
    fg

    Note: Not available
    1. Report
  8. Question: Which design pattern reduces network traffic by acting as a caching proxy of a remote object?

    A
    DataAccess Object

    B
    Model-View-Controller

    C
    Value Object

    D
    Business Delegate

    Note: Not available
    1. Report
  9. Question: 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", x); y.start();
                    T z = new T("Z", y); z.start();
            }
    }
    class T extends Thread {
            private Thread predecessor;
            private String name;
            public T(String name, Thread predecessor) { 
                    this.predecessor = predecessor; 
                    this.name = name; 
            }
            public void run() {
                    try {
                            Thread.sleep((int)(Math.random()*89));
                            System.out.print(name);
                    } catch (InterruptedException ie) {
                            ie.printStackTrace();
                    }
            }
    }

    A
    always XYZ

    B
    always ZYX

    C
    any of the following: XYZ, XZY, YXZ, YZX, ZXY, ZYX

    D
    any of the following: XYZ, ZYX

    Note: Not available
    1. Report
  10. Question: The principal finder method that must be implemented by every entity bean class is:

    A
    findByPrimaryKey()

    B
    ejbGetByPrimaryKey()

    C
    ejbFindPrimayKey()

    D
    getPrimaryKey()

    E
    getFinder()

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd