Methods | SoloLearn: Learn to code for FREE!

+5

Methods

When you create methods in your class,does the methods require parameters?

2/4/2018 2:57:25 AM

Enzo

5 Answers

New Answer

+20

That depends on your wish /*for example ::: if u want to print "helloworld" using method , then there is no need of parameters , now if u want to display enetered input using kethod , then u have to pass parameters to the method*/

+3

It's not compulsory. It depends on the task that method perform.

+1

Methods can be created with or without arguments. Method(){//code}

+1

Methods are just like functions in C

0

if your behavior is externally influenced on your objects attributes or some event to be executed yes then the method/behaviour needs parameters.