Programming Nest
Today we have a mass opportunity to flourish. In global village year of 2020 job concept has been converted with in cloud service.
A statement is a command that performs an action such as calculating a value and storing the result or displaying a message to a user. Combine statements are called methods. In a sentence A method is a named sequence of Statement. A method has a name and a body. Method name should be a meaningful identifier that indicates the overall purpose of the method.
The first statement in any C # program is
using System;
(Parameter List)
{
Method Body
}
public int findmax (int num1, int num2)
{
int result;
if (num1 > num2)
result = num1;
else
result = num2;
return result;
}
* Access Specifier − This determines the visibility of a variable or a method from another class.
* Return type − A method may return a value. The return type is the data type of the value the method returns. If the method is not returning any values, then the return type is void.
* Method name − Method name is a unique identifier and it is case sensitive. It cannot be same as any other identifier declared in the class.
* Parameter list − Enclosed between parentheses, the parameters are used to pass and receive data from a method. The parameter list refers to the type, order, and number of the parameters of a method. Parameters are optional; that is, a method may contain no parameters.
* Method body − This contains the set of instructions needed to complete the required activity.
You must explicitly specify the types of any parameters and the return type of a method. You can not use the var keyword.
Statements in C # follow a well-defined set of rules describing their format and construction. Those rules are collectively known as syntax. The specification of what statement do is collectively known as semantics.
* You can use only letters (Uppercase and lowercase), digits and underscore characters
* An Identifier must start with a letter or an underscore
C # is a case-sensitive language: footballTeam and FootballTeam are two different identifier.
Click here to claim your Sponsored Listing.
Category
Contact the business
Telephone
Address
Dhaka
1212