Java OCA OCP Practice Question 322

Question

Given a class with a public variable theTint of type Color,

which of the following methods are consistent with the JavaBeans naming standards?

  • A. public Color getColor()
  • B. public Color getTint()
  • C. public Color getTheTint()
  • D. public Color gettheTint()
  • E. public Color get_theTint()


C.

Note

The method's name is get followed by the name of the variable.

The variable name's first character is converted to uppercase.




PreviousNext

Related