Multiple choice technology programming languages

True or False. Is Foo.Print() a valid statement? Given a class Foo and it has a function public void Print (); Foo f = new Foo (); Foo.Print ();

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The method Print() is an instance method, not a static method. Therefore, it must be called on an instance of the class (f.Print()), not on the class name itself (Foo.Print()).