When you declare a method in C#, the first part of the declaration specifies the data type
of the return value, and the second part indicates the method name. If your method doesn’t
return any information, you should use the void keyword instead of a data type at the beginning
of the declaration.
// This method returns an integer.
int MyMethodReturnsData() { // As an example, return the number 10. return 10; }
No comments:
Post a Comment