nerdexam
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)
  • A
    14% (6)
  • B
    5% (2)
  • C
    75% (33)
  • E
    7% (3)

Community Discussion

No community discussion yet for this question.

Full 1Z0-819 Practice