Which method names follow the JavaBeans standard? (Choose all that apply.)
-
getCust
-
isColorado
-
addSize
-
putDimensions
JavaBeans getter naming: boolean properties use 'is' prefix (isColorado), other types use 'get' prefix (getCust). The method must be public and non-void. addSize and putDimensions don't follow getter patterns - add suggests collection manipulation, put is not a valid prefix.
To answer this question, we need to understand the JavaBeans standard. The JavaBeans standard is a set of naming conventions for methods in Java classes that are used to represent properties.
Let's go through each option to determine which ones follow the JavaBeans standard:
Option A) getCust - This method follows the JavaBeans standard. The prefix "get" indicates that this method is used to retrieve the value of a property called "cust".
Option B) isColorado - This method also follows the JavaBeans standard. The prefix "is" is used for boolean properties, and "Colorado" is the name of the property.
Option C) addSize - This method does not follow the JavaBeans standard. The prefix "add" is typically used for methods that add elements to a collection or perform some kind of addition operation.
Option D) putDimensions - This method does not follow the JavaBeans standard. The prefix "put" is typically used for methods that add or update elements in a map or dictionary.
Therefore, the correct options that follow the JavaBeans standard are A) getCust and B) isColorado.