Card 59 / 76: Which of the following methods use the proper naming convention for a getter accessing the variable totalPoints?
A)
TotalPoints()
B)
GetTotalPoints()
C)
getTotalpoints()
D)
getTotalPoints()
Answer:
D) getTotalPoints()
Previous Card | ← Previous Card Button |
Next Card | → Next Card Button |
Flip Card | Space-Bar |
variable starting with a capital letter.
A, B, and C are incorrect.
A is incorrect because it is missing get.
B is incorrect because the G in Get is capitalized, and it should be lowercase.
C is incorrect because the p in points is lowercase and should be capitalized.
|