Which of the following characters does not need to have an associated “closing” character in a Java program?

Which of the following characters does not need to have an associated “closing” character in a Java program?

a) {
b) (
c) [
d) <
e) all of these require closing characters


Answer:  d.

Explanation:  { is used to open a block, and so } is needed to close the block.  ( is used to open an expression and so ) is needed to close an expression.  [ is used to start an array index so ] is needed to close the array index.  < is “less than” and > is “greater than” and these are not needed together, so < requires no closing character.


Java

Learn More Multiple Choice Question :