66.1k views
4 votes
Many classes provide methods to perform common tasks that do not require specific objects—they must be called using a class name. Such methods are called ________ methods. a) classwide

b) dot (.)
c) console
d) static

1 Answer

4 votes

Answer:

d) static

Step-by-step explanation:

static methods are basically global, but the class that originated them must also be static.

you can use a static method without having to instantiate a new object for the class variable, for instance, let's say there are 2 classes (Car and Airplane). Car has a non-static method called "drive()" and Airplane has a static method called "fly()"

If you want to call the method from Car, you'd have to do:

Car polo = new Car();

polo.drive();

If you want to call the method from Airplane, you'd have to call it directly from the class:

Airplane.fly();

User Ranjithkumar Ravi
by
7.2k points