what is method? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is method?

30th Jun 2016, 10:48 PM
salman engineer
salman engineer - avatar
3 Answers
+ 1
I don't know how to explain.. I'll try. a method is like a group of code that returns a type of data (bool, int, and stuff), and this group of code has a name. Using this name, you call the method so you don't have to write the code over and over again... that's basically what it is. hope I didn't get you more confused....
1st Jul 2016, 1:44 AM
tumor12
+ 1
A method or a function is a collection of code that performs a given task. The goal of its existence is to write more sophisticated code - to not duplicate existing lines. If you perform the same calculation multiple times, instead of writing the same calculation over and over again - write a method. Then you will be able to use prompt it whenever you are required. I strongly sugguest reading this lesson again if you need for information or visit MSDN.
20th Jul 2016, 11:27 AM
Dainius Varanauskas
Dainius Varanauskas - avatar
- 1
simple method is the way of doing work if you want to do same work need not to writer whole code just call the method it comes with in the class
1st Jul 2016, 2:03 AM
Chandraprakash Sharma
Chandraprakash Sharma - avatar