LearnFrenzy
Sign in Take a free test

Encapsulation · Encapsulation MCQ · Question 3

Getter name for a boolean field Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 3 Back to Exercise

By JavaBeans convention, what is the getter for a boolean field active?

  • A getActive() only
  • B isActive() Correct
  • C active()
  • D hasActive()
Correct Answer: Option B

getActive() is also accepted by many tools, but isActive() is the convention.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links