Methods | SoloLearn: Learn to code for FREE!



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

2/4/2018 2:57:25 AM


5 Answers

New Answer


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*/


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


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


Methods are just like functions in C


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