According to Java naming conventions, the correct method identifier from the options provided is:
B. calculateBill
Here's a breakdown of the naming conventions in Java:
Classes should be named using PascalCase (also known as UpperCamelCase), where each word starts with a capital letter (e.g., BillCalculator or Calculator). So A and D are valid class names, not method names.
Methods should be named using camelCase (also known as lowerCamelCase), where the first word is lowercase and subsequent words start with an uppercase letter (e.g., calculateBill). Thus, B is correct.
C. calculatebill uses all lowercase letters for the second part of the identifier, which does not follow the camelCase convention, making it incorrect.
So, B is the only correct answer for a method identifier according to Java naming conventions.
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
brunojee
2 months, 3 weeks ago