Basics Types

1

Which of these events will be generated if we close an applet's window?

A. ActionEvent
B. ComponentEvent
C. AdjustmentEvent
D. WindowEvent

2

What is the name of the thread in output of this program?

    class multithreaded_programing {
        public static void main(String args[]) {
            Thread t = Thread.currentThread();
            System.out.println(t.isAlive());        
        }
    }
A. 0
B. 1
C. true
D. false

3

What is the output of this program?

    class output {
        public static void main(String args[])
        { 
           StringBuffer s1 = new StringBuffer("Hello");
           StringBuffer s2 = s1.reverse();
           System.out.println(s2);
        }
    }
A. Hello
B. olleH
C. HelloolleH
D. olleHHello

4

What is the output of this program?

    class exception_handling {
        public static void main(String args[]) {
            try {
                int i, sum;
                sum = 10;
                for (i = -1; i < 3 ;++i) {
                    sum = (sum / i);
                System.out.print(i);
                }
            }
            catch(ArithmeticException e) {     	
                System.out.print("0");
            }
        }
    }
A. -1
B. 0
C. -10
D. -101

5

Which of these events will be notified if scroll bar is manipulated?

A. ActionEvent
B. ComponentEvent
C. AdjustmentEvent
D. WindowEvent