Logo

Java Questions Set 30:

Quiz Mode

Which of the following is a source code management tool?

1
2
3
4

Solution:

What is the main advantage of using a JDBC connection pool?

1
2
3
4

Solution:

 

public class j{

public static void main(String args[]){

System.out.println(!true ? 12345:'B');

}

}

1
2
3
4

Solution:

What will be the output of the following Java program?


import java.lang.System;

class Output

{

public static void main(String args[])

{

System.exit(5);

}

}

1
2
3
4

Solution:

 

Statement - why java is not 100% oops

1
2
3
4

Solution:

Which of the following applications may use a stack?

1
2
3
4

Solution:

What will be the output?

class Main {

    public static void main(String args[]) {   

             System.out.println(sum());

    } 

  

    int sum()

    {

      return 10+20;

    }

}

1
2
3
4

Solution:

What is the output of this program?

class A 

{

        public static void main(String args[]) 

        {    

             int m=n=o=20;

             System.out.print(m);

 

        } 

}

1
2
3
4

Solution:

What will be the output of the following Java program?


class Output

{

public static void main(String[] args)

{

StringBuffer s1 = new StringBuffer("Hello");

StringBuffer s2 = s1.reverse();

System.out.println(s2);

}

}

1
2
3
4

Solution:

    import java.util.*;

    class output 

    {

        public static void main(String args[]) 

        {

            Stack obj = new Stack();

            obj.push("A");

            obj.push("B");

            obj.push("C");

            obj.push("E");

            obj.pop();

System.out.println(obj.peek());

        }

    }

1
2
3
4
5

Solution: