Is the nextInt method of the Scanner class an accessor or a mutator in Java?
<p>My textbook defined a mutator method as a method that modifies the object on which it operates. </p>

<p>And, it defines an accessor method as a a method that queries the object for some information without changing it.</p>

<p>Am I correct in saying nextInt is an accessor method?</p>

<p>My reasoning is that nextInt does not modify the object on which it operates. If I have created a Scanner object called in, when I write "int a = in.nextInt();" it does not modify the actual Scanner object. Instead, it is used as a kind of getter method to assign a value to a.</p>