The correct answers is:
A: return the value of c count, NOTE getTotalCount() is the sum of all fields (a+b+c +d), but getCount is retrive by aritmetic operation that getTotalCount() -a -b -g => then the value of c is
B: return the value of tCount.
NOT VALID:
C-> retrieve the parameter value
D-> throw a StackfOverflowExp..
E-> retrive thhe sum of all fields not a single value for some field
B & E are correct.
code:
int aCount;
int tCount;
int cCount;
int gCount;
int getAcount(int aCount) {
return aCount;
}
int getTCount(int tCount){
return this.tCount;
}
int getGCount() {
return getGCount();
}
int getCCount() {
return getTotalCount() - this.aCount - getTCount(0) - gCount;
}
int getTotalCount() {
return aCount + getTCount(0) + this.cCount + this.gCount;
}
getTotalCount cannot get a instance field, you get sum of all fields, but in getCcount you can get value of c count => getTotalCount() -a -b -g = ccount . E is not valid
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.
cathDev
3 months, 3 weeks agod7bb0b2
6 months, 1 week agoduydn
8 months, 1 week agod7bb0b2
6 months, 1 week ago