Logo

Java Questions Set 249:

Quiz Mode

Which method is used to determine if a thread is still running?

1
2
3
4

Solution:

Which of these methods is used to check for infinitely large and small values?



1
2
3
4

Solution:

Which of these method(s) is/are used for writing bytes to an OutputStream?

1
2
3
4

Solution:

Select how you would start the program to cause it to print: Arg is 2

1
2
3
4

Solution:

class test{

public static void main (String[] args) {

   int a= 15;

   int b= 30;

   int c=a^b;

   System.out.println(~(~c)^~(a&b));

}

}

1
2
3
4

Solution:

public class abekus

{  

public static void main(String[] args) {

String str = "4434.94";

int a = Integer.parseInt(str);

System.out.println(a);

}

}

1
2
3
4

Solution:

What happens when a constructor is defined for an interface?

1
2
3
4

Solution:

 What will be the out of the following program - 

class Circle {

    public static void main(String args[]) 

   { 

       double r, pi, area;

       radius = 7.8;

       pi = 3.14;

       a = pi * radius * radius;

      System.out.println(area);

      } 

  }

1
2
3
4

Solution:

What will be the output of the following Java program?


public 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, 2, b, 3, a.length - 4);

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

}

}

1
2
3
4

Solution: