Logo

Java Questions Set 75:

Quiz Mode

Which of these is the wildcard symbol?

1
2
3
4

Solution:

 Static methods must only access static data 

1
2

Solution:

To concatenate 2 or more strings we use _____ operator.

1
2
3
4

Solution:

The isInfinite() method returns the value of the invoking object as a double.

1
2
3
4

Solution:

Choose a correct option for the correct declaration of an abstract method.

1
2
3
4

Solution:

class test{

public static void main (String[] args) {

  int sum = 0;

       for (int i = 0, j = -2; i < 5 & j <= 5; ++i, j = i + 1)

                 sum += i;

    System.out.println(sum);

}

}

1
2
3
4

Solution:

A) Heap memory provides run time memory for java objects.


B) Non-heap memory is used to store per-class structures and other meta data of methods & constructors.

1
2
3
4

Solution:

what should be the output of this code block?

public class abekus

{

public void sum(int a, int b){

    System.out.print(a+b);

  }

public static void main(String[] args) {

sum(0,0);

sum(-1,-1);

}

}

1
2
3
4

Solution:

What will be the output of the following code if no argument is passed?

class abc

{

    public static void main(String args[])

    {

        if(args.length>0)

        System.out.println(args.length);

    }

}

1
2
3
4

Solution:

Predict the output of the following Java program. Assume that int is stored using 32 bits.

class Abekusmain {

public static void main(String args[]) {

int i = -1;

System.out.println(i >>> 30);

System.out.println(i >>> 28);

System.out.println(i >>> 31);

}

}

1
2
3
4

Solution: