156k views
4 votes
Methods that require you to use an object to call them are called ____ methods.1. accessor2. instance3. internal4. static

1 Answer

0 votes

Answer:

Option 2 i.e., instance methods is the correct answer to the following question.

Step-by-step explanation:

Because the instance method or function is the function that needed the class object to be called.

For Example:

//header file

#include <iostream>

using namespace std;

//define class

class Test

{

public:

//instance method

void getins()

{

cout<<"I AM Instance method";

}

};

int main()

{

//creating object

Test obj;

//calling of instance method through class object

obj.getins();

}

Output:

I AM Instance method

User Shariq Musharaf
by
5.7k points