Logo

Java Questions Set 5:

Quiz Mode

  try need not be followed by anything 

1
2

Solution:

The character range of ASCII is?

1
2

Solution:

FileReader is much better than BufferedReader

1
2

Solution:

Java is 

1
2
3
4

Solution:

What kind of methods does an interface contain by default?

1
2
3
4

Solution:

Which of the following statements is/are true about Java Servlets?

1
2
3
4

Solution:

What will happen if a constructor has a return type?

1
2
3
4

Solution:

Predict the output of the following Java code:

class Abekus {

public static void main(String args[])

{

int s = 0;

for (int i = 0, j = 0; i < 6 & j < 10; ++i, j = i + 2)

s += i;

System.out.println(s);

}

}

1
2
3
4

Solution:

class test {

public static void main (String[] args) {

     int var1=9;

              int var2=10;

              if(++var1++==++var2)

                  System.out.println(++var2);

              else 

                  System.out.println(++var1);

}

}

1
2
3
4

Solution:

 What will be the output of the following code?

class A
   {
       int factorial (int n)
       {

           int result;
          if (n == 1)
               return 1;
           result = func (n - 1);
           return result;
       }
   }
   class Output
   {
       public static void main(String args[])
       {
           A a = new A() ;
           System.out.print(a.factorial(6));
       }
   }

1
2
3
4

Solution: