Académique Documents
Professionnel Documents
Culture Documents
Bibek Kumar
CSE Deptt. DITU
bibek.kumar@dituniversity.edu.in
Equals() Method
There are two versions of Equals method. They are implemented as follows:-
bool b1= s2.Equals(s1);
bool b2= string.Equals(s2,s1);
These methods returns a Boolean value true if s1 and s2 are equal, otherwise false.
The == Operator
bool b3= (s1==s2); //b3 is true if they are equal
We very often use such statements in decision statements, like:-
if(s1==s2)
\b , \B, \S* and | are metacharacters and m, er ,X, space and comma are Literals.
using System;
class PassByValue
{
static void Change(int m)
{
m=m+10; //Value of m is changed.
}
public static void Main()
{
int x=100;
Change(x);
Console.WriteLine("x="+x);
}
}