202k views
5 votes
Accessor instance method names typically begin with the word "____" or the word "____" depending on the return type of the method.1. set, is2. get, can3. set, get 0%4. get, is

User Fatouma
by
5.8k points

1 Answer

5 votes

Answer:

3. set , get

Step-by-step explanation:

Accessor instance method are the properties of a class member variable. These methods are used to either get the values of the variable of the class or to set or initialize the member variable values of the class.Every member variable of the class should have these accessor instance methods ideally. These are of 2 types -

  1. set() - The return type of this method is void as this does not return anything and its takes argument of same datatype as the variable whose value is to be initialized . For example - void set (string name){ this.name=name;}
  2. get() - This method returns the data type same as the variable as this is used to get the value of that member variable and it accepts no arguments. For example - string get () { return this.name; }

User TheMaskedCucumber
by
5.7k points