java-mcqs - Set (4)

Correct Answer: Orange && Worng Answer: Red

1. Which of the following is not OOPS concept in java

  • (A). Inheritance
  • (B). Encapsulation
  • (C). Polymorphism
  • (D). Compilation
  • View Answer

    Explanation: Not Avilable

    2. Which of these keywords is used to make a class

  • (A). Class
  • (B). Struct
  • (C). Int
  • (D). None of the mentioned
  • View Answer

    Explanation: Not Avilable

    3. What is the return type of a method that does not return any value

  • (A). Int
  • (B). Float
  • (C). Void
  • (D). Double
  • View Answer

    Explanation: Not Avilable

    4. Method having same name as its class name is

  • (A). Struct
  • (B). Enum
  • (C). Constructor
  • (D). Argument
  • View Answer

    Explanation: Not Avilable

    5. Which method can be defined only once in a program

  • (A). Main method
  • (B). Finalize method
  • (C). Static method
  • (D). Private method
  • View Answer

    Explanation: Not Avilable

    6. Size of an integer can be

  • (A). -2^31 to 2^31-1
  • (B). 0 to -2^16
  • (C). -2^8 to 2^8 -1
  • (D). -2^15 to 2^15 -1
  • View Answer

    Explanation: Not Avilable

    7. Which of the following assignment operator doesn’t exist in java

  • (A). >>
  • (B). %=
  • (C). >>>
  • (D). <<
  • View Answer

    Explanation: Not Avilable

    8. Which loop is always executed once

  • (A). For
  • (B). For each
  • (C). Do..while
  • (D). While
  • View Answer

    Explanation: Not Avilable

    9. Which of the following is not valid flow control statement

  • (A). Break;
  • (B). Continue outer;
  • (C). Return;
  • (D). Exit();
  • View Answer

    Explanation: Not Avilable

    10. A top level class may have which one of the following access modifiers

  • (A). Package
  • (B). Private
  • (C). protected
  • (D). public
  • View Answer

    Explanation: Not Avilable

    11. A subclass in also called as

  • (A). Inner class
  • (B). Nested class
  • (C). Derived class
  • (D). Hidden class
  • View Answer

    Explanation: Not Avilable

    12. Which of the following is not a wrapper class

  • (A). Vector
  • (B). Character
  • (C). Boolean
  • (D). Integer
  • View Answer

    Explanation: Not Avilable

    13. A default constructor has

  • (A). No arguments
  • (B). Has no return type
  • (C). Has one argument but no return type
  • (D). Has two arguments
  • View Answer

    Explanation: Not Avilable

    14. Math class belongs to the package

  • (A). Java.math
  • (B). Java.lang
  • (C). Java.util
  • (D). None of these
  • View Answer

    Explanation: Not Avilable

    15. A package is a collection of

  • (A). Classes
  • (B). Interfaces
  • (C). Editing tools
  • (D). Class and interfaces
  • View Answer

    Explanation: Not Avilable