Java Java Objects Harnessing the Power of Objects Filling the Dispenser


How do I know if I need parameters in my method??

1 Answer

Balazs Pukli
Balazs Pukli
46,070 Points

Does it need an input or not?

I could write a method which prints "Hello Student!" to the screen. In that case, there is no need for parameters.

But... what if I want to print "Hello Dylan!", when you are there, and the exact name for anyone else? In that case, the method will be constructed in a way that there will be a (string name) parameter passed which we can use.

Keep up the good work! Much love!