Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# method

/* --Syntax--
[] = Optional
<> = Required
[modifiers] <return type> <identifier>([<parameter type> <parameter identifier>])
{
  //Code block
  //Return is required if type is not 'void'
  return null;
} */
//Example
/*Modifiers   Return Type	Identifier	Parameters, optional, separate with comma*/
public static bool 			MyFunc		(int x, int y)
{
  	x = x * 2;
    return x > y; //Omittable if return type is void
}
//Shortened to return the given expression |Expression body definition|	
public static int answerToEverything() 		=> 42;
 
PREVIOUS NEXT
Tagged: #method
ADD COMMENT
Topic
Name
7+6 =