Instruction

  • This test contains a total of 15 questions.
  • Do not switch the tab or open a new window, otherwise, the test will be submitted automatically.
  • Test time is 10 minutes.

Java Intermediate (Level 2)

Q 1.
Which of these is not a bitwise operator?

Q 2.
What will be the output of the following Java program?
class Output 
    { 
        public static void main(String args[])
        {
            int a = 1;
            int b = 2;
            int c = 3;
            a |= 4; b >>= 1;
            c <<= 1; a ^= c;
            System.out.println(a + " " + b + " " + c);
        } 
    }

Q 3.
Which of these have highest precedence?

Q 4.
What is the order of precedence (highest to lowest) of following operators?
1. & 
2. ^ 
3. ?:

Q 5.
Which of these selection statements test only for equality?

Q 6.
Which of these jump statements can skip processing the remainder of the code in its body for a particular iteration?

Q 7.
What will be the output of the following Java program?
    class jump_statments
    {
        public static void main(String args[])
        {
            int x = 2;
            int y = 0;
            for (; y < 10; ++y)
            {
                if (y % x == 0)
                    continue;
                else if (y == 8)
                    break;
                else
                    System.out.print(y + " ");
            }
        }
    }

Q 8.
Which of the following is a type of polymorphism in Java?

Q 9.
Which concept of Java is achieved by combining methods and attribute into a class?

Q 10.
 What is it called where object has its own lifecycle and child object cannot belong to another parent object?

Q 11.
What is true about private constructor?

Q 12.
What is true about constructor?

Q 13.
What is true about protected constructor?

Q 14.
 Which of the following is a garbage collection technique?

Q 15.
Which exception is thrown when java is out of memory?


Time: