Exam 1z0-819 All QuestionsBrowse all questions from this exam
Question 176

Given:

Which two methods modify field values? (Choose two.)

    Correct Answer: C, D

    The methods that modify field values are setAllCounts and setGCount. The setGCount method takes an integer argument and assigns its value to the gCount field. It then returns the value of the gCount field. The setAllCounts method takes an integer argument and assigns its value to aCount, tCount, and cCount fields using chained assignment. It also calls the setGCount method with the argument, which assigns the value of the argument to the gCount field.

Discussion
d7bb0b2Options: CD

C,D only, setTcount() not modified field because set the same t parameter of class this.t = t (tricky), IF this method recive a a int parameter it so then modified value

StavokOptions: CD

C. setAllCounts and D. setGCount. The setGCount method takes an integer argument g and assigns its value to the gCount field. It then returns the value of the gCount field. The setAllCounts method takes an integer argument x and assigns its value to the aCount, tCount, and cCount fields using chained assignment. It also calls the setGCount method with the argument x, which assigns the value of x to the gCount field.

KiraguJohnOptions: CD

Answer is C,D setAllCounts and setGCount