Logo

Java Questions Set 219:

Quiz Mode

IOException occurs at the time of open the file reader

1
2

Solution:

How to specify autowiring by name?

1
2
3
4

Solution:

Which component is responsible for optimizing bytecode to machine code?

1
2
3
4

Solution:

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

1
2
3
4

Solution:

Which method is used to verify the actual and expected results in JUnit?

1
2
3
4

Solution:

  public String replaceAll(string replace) replace all other than the first subsequence of that matches the pattern with a replacement string 


1
2

Solution:

Which is the valid declaration within an interface definition?

1
2
3
4

Solution:

What will be the output of the following Java program?


class Output

{

public static void main(String[] args)

{

String c = " ​Hello World ​";

String s = c.trim();

System.out.println("\"" + s + "\"");

}

}

1
2
3
4

Solution:

 Statement 1-BufferedReader used to read 6000 bits at a time.

 Statement 2- BufferedReader used to read 7000 bits at a time. 

 Statement 3- BufferedReader used to read 8000 bits at a time.

1
2
3
4
5

Solution:

 class method 

    {

        static int i;

     static int j;

        void add(int a , int b)

        {

            i =++j + ++b;

            j =i + b;

        }

    }    

    class output 

    {

        public static void main(String args[])

        {

            method obj1 = new method();

            method obj2 = new method();   

            int a = 5;

            obj1.add(a, a+1);

            obj2.add(6, a);

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

        }

   }

1
2
3
4

Solution: