33.1k views
3 votes
Before an object method can be called, the object must be created using what keyword?

1 Answer

5 votes

Final answer:

The keyword used to create an object in programming is 'new'. Before calling a method on an object, the object must first be created using the 'new' keyword.

Step-by-step explanation:

The keyword used to create an object in programming is new. Before calling a method on an object, the object must first be created using the new keyword. This keyword is used to allocate memory and initialize the object. Here's an example:

ClassName objectName = new ClassName();
objectName.methodName();

In this example, the new keyword is used to create an instance of the ClassName class and then the methodName is called on the object.

User Nicolas Dorier
by
8.6k points

No related questions found