Quiz 2
Quiz 2
o A) Hello5
o B) 5Hello
o C) Hello23
o D) Error
o A) interface
o B) string
o C) Float
o D) unsigned
o A) java.io
o B) java.util
o C) java.lang
o D) java.text
o A) 8 bytes
o B) 2 bytes
o C) 4 bytes
o D) 1 byte
o A) Integer
o B) int
o C) String
o D) float
7. What is the default value of a boolean variable in Java?
o A) true
o B) false
o C) null
o D) 0
o A) =
o B) ==
o C) !=
o D) :=
o A) if
o B) switch
o C) for
o D) try
Intermediate Level
o A) try
o B) catch
o C) finally
o A) HelloWorld!
o B) Hello World!
o C) Hello + World!
o D) Hello + "World!"
o A) It cannot be extended.
o B) It can be extended.
o C) It can be instantiated.
o D) It has no methods.
o A) extends
o B) implements
o C) inherits
o D) super
17. In Java, which statement is used to end the execution of a method and return a value to
the caller?
o A) break
o B) exit
o C) return
o D) continue
Advanced Level
20. Which Java feature allows fields and methods to be accessed in subclasses even if they are
in different packages?
o A) public
o B) protected
o C) private
o D) default