Multiple choice

What is not true for a Java bean?

  1. There are no public instance variables.

  2. All persistent values are accessed using getxxx and setxxx methods.

  3. It may have many constructors as necessary.

  4. All of the above are true of a Java bean.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Java Beans must have a no-argument constructor, public getter/setter methods following naming conventions (getXxx, setXxx, isXxx for boolean), and no public instance variables. Having many constructors is NOT standard for Java Beans - they specifically require a no-arg constructor for instantiation by reflection/tools.