Tag: java

Questions Related to java

  1. Compilation and running with output 0 to 9

  2. Run time error: Constructors cannot be declared protected

  3. Compilation error: Constructors cannot be declared protected

  4. Compilation and running with output 0 to 10

  5. None of the above


Correct Option: A
  1. Strings are a primitive type in Java and the StringBuffer is used as the matching wrapper type

  2. The size of a string can be retrieved using the length property.

  3. Strings are a primitive type in Java that overloads the + operator for concatenation

  4. The String class is implemented as a char array, elements are addressed using the stringname[] convention


Correct Option: C
  1. Static

  2. Private

  3. Default

  4. None of the above


Correct Option: B
  1. Compilation error

  2. Runtime error

  3. No errors

  4. Execptions


Correct Option: C
  1. A methods in object

  2. An operator and keyword

  3. Both

  4. None


Correct Option: B

What is the size of a Char?

  1. 4 bits

  2. 7 bits

  3. 8 bits

  4. 16 bits


Correct Option: D