134k views
5 votes
If an object someThing has a method someMethod( ), then you can call the method using the statement ____________ .

a. someMethod(someThing);
b. someThing.someMethod( );
c. someMethod.someThing() ;
d. someThing = someMethod( );

User Poojagupta
by
4.6k points

1 Answer

2 votes

Answer:

C) someThing.someMethod( )

Step-by-step explanation:

The methods in a class can be accessed outside the class (assuming they are public methods and not private to the class) by using the dot(.) symbol and calling the method on the instance or object of the class.

In this case, the object of the class someThing, calls the method, someMethod( ) by using a dot and the name of the method with a parentheses at the end. This enables the code in the method act on the class instance or object.

User Fannheyward
by
4.9k points