Hi, sorry for the extremely basic question, but I'm confused about something. I'm studying for my next computer science exam, and looking over past tests. One of the questions gives us three different methods and asks us to write statements to invoke them, which sounds really easy, and I thought that I had done it correctly. However, my professor gave us the correct output, and apparently, when you invoke a method and run the program, Java is supposed to output "methodWhatever has been invoked.", which my program isn't doing.
I'm very confused. I thought that to invoke a method, all you had to do was pass it actual arguments that correspond to the method's parameters, but I'm doing that, and I'm still not getting any output. Maybe I'm missing something?
These are the methods that we're supposed to invoke:
public int fancyOpA (int x, String y){ return 0; } public double fancyOpB (int x, double y){ return 0; } public static double fancyOpC (int x, int y){ return 0; }
And here are the statements that I have to invoke them:
int invokeA = fancyOpA(6, "bluh"); double invokeB = fancyOpB(6, f); double invokeC = fancyOpC(6,7);