Logo

Java Questions Set 92:

Quiz Mode

We can pass ______ number of arguments to main().

1
2
3
4

Solution:

Which of these keywords is used to generate an exception explicitly?

1
2
3
4

Solution:

Which of these classes extends the InputStream class?

1
2
3
4

Solution:

Which class is used for input and output operation when working with bytes?

1
2
3
4

Solution:

What exception is thrown by the parseInt() method?

1
2
3
4

Solution:

Which of these methods returns the smallest whole number greater than or equal to a given variable X?

1
2
3
4

Solution:

Which three are valid declarations of a float?

  1. float f1 = -343;
  2. float f2 = 3.14;
  3. float f3 = 0x12345;
  4. float f4 = 42e7;
  5. float f5 = 2001.0D;
  6. float f6 = 2.81F

1
2
3
4

Solution:

What will be the output of the following Java code?


class MultithreadedProgramming

{

public static void main(String[] args)

{

Thread t = Thread.currentThread();

t.setName("New Thread");

System.out.println(t);

}

}

1
2
3
4

Solution:

What will be the output of the following Java program?


import java.lang.System;

class Output

{

public static void main(String args[])

{

byte a[] = { 65, 66, 67, 68, 69, 70 };

byte b[] = { 71, 72, 73, 74, 75, 76 };

System.arraycopy(a, 0, b, 0, a.length);

System.out.print(new String(a) + " " + new String(b));

}

}

1
2
3
4

Solution: