I did't understand "The main method should call the sqr method with 5 as an argument."
Rajesh Kumar Singh
The main method should call the sqr method with 5 as an argument
You must be signed in to leave a comment
8 May 2019, 09:13
Remember this, a method can call another method inside its body. The general syntax of a method is :For example, lets declare a method that sums two number, we are going to call this method sum Here, in line 1, inside the first bracket, are the arguments of this method. This means that when you want to call this method from another part of your program you have to call this with the values or variables that will be used to pass value to each arguments. So here we should call this 'sum' method in this way: here, a variable 'x' is used because the 'sum' method returns a value which needs to be stored somewhere in the memory. Hope that clears your confusion. If you have any other question, don't hesitate to ask.