Question: Suppose there is a class called Thing and you attempt to call a method called myThing() like this: Thing.myThing(); Which of the following is true?

Suppose there is a class called Thing and you attempt to call a method called myThing() like this:

Thing.myThing(); 

Which of the following is true?

Group of answer choices

this will not compile because you need to use an object not a class in front of the . when you call a method

this will work but only if there is only a single object of class Thing because otherwise Java cannot tell which you intend to call

this will work but will call the myThing() method for all objects of the class Thing that have been created at that point

this will work provided that myThing() is not static

this will work provided that myThing() is static

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To determine which statement is true regarding calling the method myThing using ThingmyThing lets understand the difference between static and instanc... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!