java-mcqs - Set (1)

Correct Answer: Orange && Worng Answer: Red

1. Which of the following has highest memory requirement?

  • (A). Heap
  • (B). Stack
  • (C). JVM
  • (D). Class
  • View Answer

    Explanation: Not Avilable

    2. Which of these operators is used to allocate memory for an object ?

  • (A). malloc
  • (B). alloc
  • (C). new
  • (D). give
  • View Answer

    Explanation: New operator dynamically allocates memory for an object.

    3. In Java objects are passed as :

  • (A). Copy of that object
  • (B). Method
  • (C). Default Constructor
  • (D). Memory address
  • View Answer

    Explanation: Not Avilable

    4. Which is a reserved word in the Java Programming language ?

  • (A). Method
  • (B). Native
  • (C). Subclass
  • (D). Reference
  • View Answer

    Explanation: Not Avilable

    5. Command to execute a compiled Java program is :

  • (A). Java C
  • (B). Java
  • (C). Run
  • (D). Execute
  • View Answer

    Explanation: Command Java is used to execute compiled program and Java C is used to compile java program.

    6. The default value of a static integer variable of a class in Java :

  • (A). 0
  • (B). 1
  • (C). Garbage value
  • (D). -1
  • View Answer

    Explanation: Not Avilable

    7. In Java objects are created by which keyword ?

  • (A). Object
  • (B). New
  • (C). Abstract
  • (D). None of these
  • View Answer

    Explanation: Not Avilable

    8. The process by which one object acquires the properties of another object is called :

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

    Explanation: Not Avilable

    9. Java Compiler Java C translate Java source code into :

  • (A). Assembly language
  • (B). Byte code
  • (C). Bit code
  • (D). Machine code
  • View Answer

    Explanation: Not Avilable

    10. Which operator is used for concatenation in Java ?

  • (A).
  • (B). Dot
  • (C). *
  • (D). +
  • View Answer

    Explanation: ‘+’ operator in java can be used to add numbers and concatenate strings.

    11. Which of these keywords must be used to monitor for exceptions ?

  • (A). Try
  • (B). Finally
  • (C). Throw
  • (D). Catch
  • View Answer

    Explanation: Not Avilable

    12. Which of these keywords is used to manually throw an exception ?

  • (A). Try
  • (B). Follow
  • (C). Throw
  • (D). Catch
  • View Answer

    Explanation: 'throw' keyword is used for throwing exception manually in java program.

    13. Which of these is not a bitwise operator ?

  • (A). &
  • (B). &=
  • (C). |
  • (D). None of these
  • View Answer

    Explanation: Not Avilable

    14. What is the output of relational operators ?

  • (A). Integer
  • (B). Boolean
  • (C). Characters
  • (D). Double
  • View Answer

    Explanation: The output of relational operator is boolean value which is true or false.

    15. Which of these have highest precedence ?

  • (A). ()
  • (B). ++
  • (C). *
  • (D). >>
  • View Answer

    Explanation: Not Avilable