Oracle
1Z0-819 · Question #26
Given: public class DMASynth { int aCount; int tCount; int cCount; int gCount; int getAcount(int xCount){ return aCount; } int getTcount(int tcount){ return this.tCount; } int getCcount(){ return…
The correct answer is C. getTotalCount D. getCcount. See the full explanation below for the reasoning.
Question
Given:
public class DMASynth {
int aCount;
int tCount;
int cCount;
int gCount;
int getAcount(int xCount){
return aCount;
}
int getTcount(int tcount){
return this.tCount;
}
int getCcount(){
return getTotalCount() - this.aCount - getTcount(0) - gcount;
}
int getGcount(){
return this.getGcount();
}
int getTotalcount(){
return aCount + getTcount(0) + this.cCount + this.gCount;
}
}
Which two methods facilitate valid ways to read instance fields? (Choose two.)
Options
- AgetAcount
- BgetBcount
- CgetTotalCount
- DgetCcount
- EgetGcount
How the community answered
(44 responses)- A14% (6)
- B5% (2)
- C75% (33)
- E7% (3)
Community Discussion
No community discussion yet for this question.