Logo

Java Questions Set 262:

Quiz Mode

  try block need not to be followed by catch block 

1
2

Solution:

The component responsible for running a java program

1
2
3
4

Solution:

Which of the following can be used with 'switch' statement

1
2
3
4

Solution:

Which of these is a wrapper class for the int data type?

1
2
3
4

Solution:

The attribute which is used to specify that the script is executed when the page has finished parsing is ____

1
2
3
4

Solution:

import java.time.LocalDate;

public class LocalDateExample{

 public static void main(String[] args){

  LocalDate date1 = LocalDate.of(2017,1,13);

  System.out.println(date1.isLeapYear());

 }

}

1
2

Solution:

class test{

public static void main (String[] args) {

   int a = 5; 

            int b = 6;

            int c;

            c = ++ b * a / b + b;

            System.out.print(~c^b);

}

}

1
2
3
4

Solution:

Predict the output of the following Java code:

class Abekus {

int a = 20;

Abekus() { a = 40; }

}

class Abekusmain {

public static void main(String args[]) {

Abekus o = new Abekus();

System.out.println(o.a);

}

}

1
2
3
4

Solution:

What will be the output of the program?

class SSBool
{
   public static void main(String [] args)
   {
       boolean b1 = true;
       boolean b2 = false;
       boolean b3 = true;
       if ( b1 & b2 | b2 & b3 | b2 ) /* Line 8 */
           System.out.print("ok ");
       if ( b1 & b2 | b2 & b3 | b2 | b1 ) /*Line 10*/
           System.out.println("dokey");
   }
}

1
2
3
4

Solution: