Logo

Java Questions Set 7:

Quiz Mode

Which will contain the body of the thread?

1
2
3
4

Solution:

Which of these Java collections is sorted by default?

1
2
3
4

Solution:

Which event is generated when a scroll bar is manipulated?

1
2
3
4

Solution:

Java interface can contain ____________

1
2
3
4

Solution:

Which of the following lists contain only valid Java keywords?

1
2
3
4

Solution:

public class outputs 

    {

        public static void main(String args[]) 

        {

            int a=10;

int b=20;

int sum=0;

sum= a%b;

System.out.println(sum);

        } 

    }

1
2
3
4

Solution:

public class Demo123{

     public static void main(String args[]){

String s1= new String("Hello");

String s2= new String("Hello");

System.out.println(s1.charAt(0)>s2.charAt(0));

   }

}

1
2
3
4

Solution:

public class outputs 

    {

        public static void main(String args[]) 

        {

            int a=10;

int b=20;

int c=30;

int sum=0;

sum= a++ + b++ + b/c++ + a/c++;

System.out.println(sum);

        } 

    }

1
2
3
4

Solution:

What will be the output of the following Java code?

class Output { public static void main(String args[]) { double x = 3.14; int y = (int) Math.abs(x); System.out.print(y); } }

1
2
3
4

Solution:

What will be the output of the following code?

final class A 

    {

         int i;

    }    

    class B extends A 

    {

        int j;

        System.out.println(j + " " + i);  

    }    

    class inherit

    {

        public static void main(String args[])

        {

            B obj = new B();

            obj.display();     

        }

   }

1
2
3
4

Solution: