Logo

Java Questions Set 154:

Quiz Mode

When we run two or more programs concurrently, it is called?

1
2

Solution:

Predict the output of the following Java code.

1
2
3
4

Solution:

Which of the following is not an inheritance mapping strategy?

1
2
3
4

Solution:

Which three form part of correct array declarations?

  1. public int a [ ]
  2. static int [ ] a
  3. public [ ] int a
  4. private int a [3]
  5. private int [3] a [ ]
  6. public final int [ ] a

1
2
3
4

Solution:

What are generic methods?

1
2
3
4

Solution:

Predict the output of the following Java code.

class Abekus { 

private int i; 

private Abekus() { 

i = 76; 

public class Abekus1 { 

public static void main(String[] args) { 

Abekus A = new Abekus(); 

System.out.println(A.i); 

1
2
3
4

Solution:

//Predict the output

import java.util.Scanner;

public class Main

{

    public static void main(String args[])

    {

        StringBuilder str = new StringBuilder("Electronic");

        int unicode = str.codePointBefore(4);

        System.out.println(" "+ unicode);

    }

}

1
2
3
4

Solution:

Predict the output of the following Java code:

class Abekus {

public static void main(String args[])

{

StringBuffer s1 = new StringBuffer("Welcome to");

StringBuffer s2 = new StringBuffer(" Abekus");

s1.append(s2);

System.out.println(s1);

}

}

1
2
3
4

Solution:

public class While
{
   public void loop()
   {
       int x= 0;
       while ( 1 ) /* Line 6 */
       {
           System.out.print("x plus one is " + (x + 1)); /* Line 8 */
       }
   }
}

Which statement is true?

1
2
3
4

Solution:

Which statements about constructors in Java are true?

1
2
3
4

Solution: