Solved

Consider the Following Code Snippet

Question 66

Multiple Choice

Consider the following code snippet:
Public class Course
{
Private int studentCount;
) . .
}
Which of the following methods would correctly keep track of the total number of enrollees in a course?


A) public void addEnrollees(int newEnrollees)
{
StudentCount = newEnrollees
}
B) public void addEnrollees(int newEnrollees)
{
StudentCount = studentCount + newEnrollees
}
C) public void addEnrollees(int newEnrollees)
{
NewEnrollees = studentCount
}
D) public void addEnrollees(int newEnrollees)
{
NewEnrollees = newEnrollees + studentCount
}

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents