Logo

Java Questions Set 130:

Quiz Mode

What is the output of the following code?

1
2
3
4

Solution:

e.getmesssage() is used

1
2
3
4

Solution:

Which of the following keywords is used with the switch statement?

1
2
3
4

Solution:

element() : This method retrieves and remove the head (first element) of this list. 

1
2

Solution:

The class which always create a single object

1
2
3
4

Solution:

Select the correct staement

1
2
3
4

Solution:

public class outputs 

    {

        static int cube(int x){

          return x*x+x*x+ ++x*x;

 

        } 

public static void main(String args[]){ 

    int result=outputs.cube(5);

 System.out.println(result);

}

}

1
2
3
4

Solution:

Select the correct option for the following Java code.

class Abekus {

public static void main(String[] args)

{

int A1[] = new int[10];

int A2[] = new int[-5];

System.out.println(A1.length);

System.out.println(A2.length);

}

}

1
2
3
4

Solution:

abstract class A

 {

   public a1(){

        System.out.println("Abekus");

      }

 }

 class B extends A{

  public b1{

        System.out.println("please give feedback");

  }

    }

 class C extends B{

   public c1{

     System.out.println("success is sure");

   }

 }

 class testcase{

  public static void main(String args[]){

     C obj = new C();

 

   }

 }

1
2
3
4

Solution:

What will be the output of the following Java program?


    class Output 

    {

        public static void main(String args[]) 

        {

            char a[] = {'b', '1', 'B', ' '};   

            System.out.print(Character.isDigit(a[0]) + " ");

            System.out.print(Character.isWhitespace(a[3]) + " ");

            System.out.print(Character.isUpperCase(a[2]));

        }

    }


1
2
3
4

Solution: