1. Question: 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 start() {
    
      int i = 2;
      int j = 3;
      int x = i & j;
      System.out.println(x);
     }
    }

    A
    The code will not compile.

    B
    The code will compile but will give a runtime error.

    C
    The code will compile and print 2.

    D
    The code will compile and print 1.

    Note: Not available
    1. Report
  2. Question: Which of the following are the methods of the Thread class?

    A
    stay()

    B
    go()

    C
    yield()

    D
    sleep(long millis)

    Note: Not available
    1. Report
  3. Question: What protocol is used by the DatagramSocket class?

    A
    STCP

    B
    UDP

    C
    TCP

    D
    FTP

    Note: Not available
    1. Report
  4. Question: Which statements are true? Select all true statements.

    A
    A member variable can be declared synchronized.

    B
    A class can be declared transient.

    C
    A class be declared synchronized.

    D
    A method can be declared synchronized.

    Note: Not available
    1. Report
  5. Question: Which exception must a setter of a constrained JavaBean property throw to prevent the property value from changing?

    A
    PropertyVetoException

    B
    IllegalArgumentException

    C
    IllegalComponentStateException

    D
    InvalidAttributeValueException

    Note: Not available
    1. Report
  6. Question: X.509 version 3 specifies which of the following?

    A
    A format and content for digital certificates.

    B
    The IPSec standard.

    C
    The Secure Socket Layer.

    D
    The Data Encryption Standard.

    E
    A file for digital certificates.

    Note: Not available
    1. Report
  7. Question: 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);
            update(b1);
        }
    
        private void update(Bar bar) {
    
            bar.x = 20;
            System.out.println(bar.x);
        }
    
        public static void main(String args[]) {
    
            new Test();
        }
    
        private class Bar {
    
            int x = 10;
        }
    }

    A
    The code will fail to compile.

    B
    10 10 10 10

    C
    20 20 20 20

    D
    10 20 10 20

    Note: Not available
    1. Report
  8. Question: Which of the following methods can be used for reporting a warning on a Connection object, Statement object & ResultSet object?

    A
    getWarnings()

    B
    getWarned()

    C
    getWarning()

    D
    getError()

    E
    getErrors()

    Note: Not available
    1. Report
  9. Question: Which of the following are valid ways to define a thread in Java?

    A
    Create a subclass of java.lang.Thread class

    B
    Create a class that implements java.lang.Runnable

    C
    Define method run() in a class

    D
    Define method call() in a class

    Note: Not available
    1. Report
  10. Question: JDBC is based on:

    A
    X/Open CLI (Call Level Interface)

    B
    JDBC/Open CLI

    C
    Java/Open CLI

    D
    V/OPEN CLI

    E
    V/CLOSE CLI

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