Logo

Java Questions Set 216:

Quiz Mode

Which of the following has highest priority.

1
2
3
4

Solution:

Which of these methods can mix all the elements of a list?

1
2
3
4

Solution:

Prepared statement queries in JDBC are used to execute which type of queries

1
2
3
4

Solution:

What will be the output of the following Java code?


class Output

{

public static void main(String[] args)

{

Double i = new Double(257.5);

boolean x = i.isNaN();

System.out.print(x);

}

}

1
2
3
4

Solution:

What is the output of the following Java code?

package Abekus;

class A {

int a = 400;

}

class Main {

public static void main(String args[]) {

A o = new A();

System.out.println(o.a);

}

}

1
2
3
4

Solution:

Predict the output of the following Java code.

class AbekusMain {

public static void main(String[] args) {

int a = -6;

System.out.println(a >> 1);

int b = 6;

System.out.println(b >> 1);

}

}

1
2
3
4

Solution:

 class Area

    {

        int breadth;

        int length;

    } 

    class mainclass 

    {

        public static void main(String args[]) 

        {        

             Area a = new Area();

             System.out.print(a);

        } 

    }

1
2
3
4

Solution:

What is the output of the following Java program?

class Test {
public static void main(String[] args) {
for (int i = 0; 0; i++) {
System.out.println("Heyaa Welcome to Abekus");
break;
}
}

}

1
2
3
4

Solution:

// It is a class Abekus.

package com.pk3;

public class Abekus{

void m1()

{

 System.out.println("Protected method of Abekus has been called.");

}

}

// This is def class.

package com.pkg2;

import com.pk3.Abekus;

public class def extends Abekus {

 public static void main(String args[]) {

  Abekus A = new Abekus();

  A.m1();

  System.out.println("This is Abekus.com");

}

}

What will be the correct output?

1
2
3
4

Solution:

What will be the output of the following Java program?


import java.io.*; public class FileInputOutput { public static void main(String[] args) { String obj = "abc"; byte b[] = obj.getBytes(); ByteArrayInputStream obj1 = new ByteArrayInputStream(b); for (int i = 0; i < 2; ++i) { int c; while ((c = obj1.read()) != -1) { if (i == 0) { System.out.print(Character.toUpperCase((char)c)); } } } } }

1
2
3
4

Solution: