ExamVeda
Login
Home
91
Which of these values are returns under the case of normal termination of a program?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
92
What will be the output of the following Java program?
class exception_handling 
{
    public static void main(String args[]) 
    {
        try 
        {
            int a = args.length;
            int b = 10 / a;
            System.out.print(a);
            try 
            {
                 if (a == 1)
                     a = a / a - a;
                 if (a == 2) 
                 {
                     int c = {1};
                     c[8] = 9;
                 }
            }
            catch (ArrayIndexOutOfBoundException e) 
            {
                System.out.println("TypeA");
            }
            catch (ArithmeticException e) 
            {
                System.out.println("TypeB");
            }
    }
}

Note: Execution command line: $ java exception_handling one two
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
93
What will be the output of the following Java program?
interface calculate
{
    void cal(int item);
}
class display implements calculate
{
    int x;
    public void cal(int item)
    {
        x = item * item;            
    }
}
class interfaces
{
    public static void main(String args[])
    {
        display arr = new display;
        arr.x = 0;      
        arr.cal(2);
        System.out.print(arr.x);
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
94
What does an interface contain?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
95
Math.random() guarantees uniqueness?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
96
What will be the output of the following Java program?
package pkg;
class output 
{
    public static void main(String args[])
    {
        StringBuffer s1 = new StringBuffer("Hello World");
        s1.insert(6 , "Good ");
        System.out.println(s1);
    }
}

Note : Output.class file is not in directory pkg.
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
97
What will be the output of the following Java program?
import java.io.*;
public class filesinputoutput 
{
  public static void main(String[] args) 
    {
 String obj  = "abc";
       byte b[] = obj.getBytes();
       ByteArrayInputStream obj1 = new ByteArrayInputStream(b);
       for (int i = 0; i < 2; ++ i) 
       {
           int c;
           while ((c = obj1.read()) != -1) 
           {
             if (i == 0) 
               {
                   System.out.print(Character.toUpperCase((char)c)); 
             }
           }
       }
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
98
How to assign values to variable using property?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
99
Which of these methods return string equivalent of Boolean object?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
100
What will be the output of the following Java program?
class Output 
{
    public static void main(String args[]) 
    {
        double x = 102;
        double y = 5;
        double z = Math.IEEEremainder(x, y);
        System.out.print(z);}
     }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board