SlideShare une entreprise Scribd logo
1  sur  15
iFour ConsultancyBasics of .NET
 Operators
 Control statements
 Access Modifiers
INDEX
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
It is a symbol that tells the compiler to perform specific mathematical or logical
manipulations. C# has rich set of built-in operators and provides the following types of
operators
• Arithmetic Operators
• Relational Operators
• Logical Operators
• Bitwise Operators
• Assignment Operators
• Misc Operators
Operators
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Arithmetic Operators
Operators (cont.)
Operator Description Example(A=10,B=20)
+ Adds two operands A + B = 30
- Subtracts second operand from the first A - B = -10
* Multiplies both operands A * B = 200
/ Divides numerator by de-numerator B / A = 2
% Modulus Operator and remainder of after an
integer division
B % A = 0
++ Increment operator increases integer value by one A++ = 11
-- Decrement operator decreases integer value by
one
A-- = 9
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Relational Operators
Operators (cont.)
Operator Description Example(A=10,B=20)
== Checks if the values of two operands are equal or not, if yes then condition
becomes true
(A == B) is not true.
!= Checks if the values of two operands are equal or not, if values are not
equal then condition becomes true
(A != B) is true
> Checks if the value of left operand is greater than the value of right
operand, if yes then condition becomes true
(A > B) is not true
< Checks if the value of left operand is less than the value of right operand, if
yes then condition becomes true
(A < B) is true
>= Checks if the value of left operand is greater than or equal to the value of
right operand, if yes then condition becomes true
(A >= B) is not true
<= Checks if the value of left operand is less than or equal to the value of right
operand, if yes then condition becomes true
(A <= B) is true
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Logical Operators
Operators (cont.)
Operator Description Example
(A=true,B=false)
&& Called Logical AND operator. If both the operands are non zero then
condition becomes true
(A && B) is false
|| Called Logical OR Operator. If any of the two operands is non zero
then condition becomes true
(A || B) is true
! Called Logical NOT Operator. Use to reverses the logical state of its
operand. If a condition is true then Logical NOT operator will make
false
!(A && B) is true
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Bitwise Operators
Operators (cont.)
Operator Description Example
(A=60=00111100
B=13=0000 1101)
& Binary AND Operator copies a bit to the result if it exists in both operands (A & B) = 12, 00001100
| Binary OR Operator copies a bit if it exists in either operand (A | B) = 61, 0011 1101
^ Binary XOR Operator copies the bit if it is set in one operand but not both (A ^ B) = 49, 00110001
~ Binary Ones Complement Operator is unary and has the effect of 'flipping' bits (~A ) = 61, which is 1100
0011
<< Binary Left Shift Operator. The left operands value is moved left by the number of
bits specified by the right operand
A << 2 = 240, which is
1111 0000
>> Binary Right Shift Operator. The left operands value is moved right by the number
of bits specified by the right operand
A >> 2 = 15, which is 0000
1111
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Assignment Operators
Operators (cont.)
Operator Description Example
= Binary AND Operator copies a bit to the result if it exists in both operands. C = A + B assigns value of
A + B into C
+= Add AND assignment operator, It adds right operand to the left operand and
assign the result to left operand
C += A is equivalent to C =
C + A
-= Subtract AND assignment operator, It subtracts right operand from the left
operand and assign the result to left operand
C-=A is equivalent to C=C-
A
*= Multiply AND assignment operator, It multiplies right operand with the left
operand and assign the result to left operand
C *= A is equivalent to C =
C * A
/= Divide AND assignment operator, It divides left operand with the right operand
and assign the result to left operand
C /= A is equivalent to C =
C / A
%= Modulus AND assignment operator, It takes modulus using two operands and
assign the result to left operand
C %= A is equivalent to C
= C % A
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Assignment Operators
Operators (cont.)
Operator Description Example
<<= Left shift AND assignment operator C <<= 2 is same as C =
C << 2
>>= Right shift AND assignment operator C >>= 2 is same as C =
C >> 2
&= Bitwise AND assignment operator C &= 2 is same as C = C
& 2
^= bitwise exclusive OR and assignment operator C ^= 2 is same as C = C
^ 2
%= bitwise inclusive OR and assignment operator C |= 2 is same as C = C
| 2
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Statement that determines whether other statements will be executed
• if statement decides whether to execute another statement, or decides which of two
statements to execute
• If -else :If the boolean expression evaluates to true, then the if block of code is executed,
otherwise else block of code is executed
• A switch statement decides which of several statements to execute
• for loops are (typically) used to execute the controlled statement a given number of times.
• The foreach statement repeats a group of embedded statements for each element in an array
or an object collection that implements
• while loops test whether a condition is true before executing the controlled statement
• do-while loops test whether a condition is true after executing the controlled statement
Control statements
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Public
• The public keyword is an access modifier for types and type members. Public access is the most
permissive access level
• Accessibility:
• Can be accessed by objects of the class
• Can be accessed by derived classes
Private
• Private members are accessible only within the body of the class or the struct in which they are
declared
• Accessibility:
• Cannot be accessed by object
• Cannot be accessed by derived classes
Access Modifiers
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Protected
• A protected member is accessible from within the class in which it is declared, and from within
any class derived from the class that declared this member
• Accessibility:
• Cannot be accessed by object
• By derived classes
Internal
• Access modifier for types and type members. We can declare a class as internal or its member
as internal. Internal members are accessible only within files in the same assembly
• Access is limited exclusively to classes defined within the current project assembly
Access Modifiers
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
• Accessibility:
• In same assembly (public)
• Can be accessed by objects of the class
• Can be accessed by derived classes
• In other assembly (internal)
• Cannot be accessed by object
• Cannot be accessed by derived classes
Protected Internal
• The protected internal accessibility means protected OR internal, not protected AND internal
• In other words, a protected internal member is accessible from any class in the same assembly,
including derived classes
Access Modifiers
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 https://www.tutorialspoint.com/csharp/
 http://www.c-sharpcorner.com/UploadFile/mkagrahari/introduction-to-object-oriented-
programming-concepts-in-C-Sharp/
References
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Questions?
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India

Contenu connexe

Tendances

.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
Best PeoplSoft Technical Online Training
Best PeoplSoft Technical Online TrainingBest PeoplSoft Technical Online Training
Best PeoplSoft Technical Online Training
Samatha Kamuni
 
Microsoft MCPD 70-492 it examen dumps
Microsoft MCPD 70-492 it examen dumpsMicrosoft MCPD 70-492 it examen dumps
Microsoft MCPD 70-492 it examen dumps
lilylucy
 

Tendances (18)

Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
Jdbc basic features
Jdbc basic featuresJdbc basic features
Jdbc basic features
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patterns
 
Schema-First API Design
Schema-First API DesignSchema-First API Design
Schema-First API Design
 
C#Portfolio
C#PortfolioC#Portfolio
C#Portfolio
 
LeverX SAP ABAP Tutorial Creating Function Modules
LeverX SAP ABAP Tutorial Creating Function ModulesLeverX SAP ABAP Tutorial Creating Function Modules
LeverX SAP ABAP Tutorial Creating Function Modules
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
 
Beginner’s tutorial (part 1) integrate redux form in react native application
Beginner’s tutorial (part 1) integrate redux form in react native applicationBeginner’s tutorial (part 1) integrate redux form in react native application
Beginner’s tutorial (part 1) integrate redux form in react native application
 
Abap package concept
Abap package conceptAbap package concept
Abap package concept
 
Best PeoplSoft Technical Online Training
Best PeoplSoft Technical Online TrainingBest PeoplSoft Technical Online Training
Best PeoplSoft Technical Online Training
 
oracle-reports6i
oracle-reports6ioracle-reports6i
oracle-reports6i
 
Microsoft MCPD 70-492 it examen dumps
Microsoft MCPD 70-492 it examen dumpsMicrosoft MCPD 70-492 it examen dumps
Microsoft MCPD 70-492 it examen dumps
 
POS/409 ENTIRE CLASS UOP TUTORIALS
POS/409 ENTIRE CLASS UOP TUTORIALSPOS/409 ENTIRE CLASS UOP TUTORIALS
POS/409 ENTIRE CLASS UOP TUTORIALS
 
Capturing requirements: Importing documents
Capturing requirements: Importing documentsCapturing requirements: Importing documents
Capturing requirements: Importing documents
 
The math api
The math apiThe math api
The math api
 
Testing soap UI
Testing soap UITesting soap UI
Testing soap UI
 
OpenERP data integration in an entreprise context: a war story
OpenERP data integration in an entreprise context: a war storyOpenERP data integration in an entreprise context: a war story
OpenERP data integration in an entreprise context: a war story
 

En vedette

009 sql server management studio
009 sql server management studio009 sql server management studio
009 sql server management studio
let's go to study
 
Your 2012 Marketing Plan: Simple & Powerful
Your 2012 Marketing Plan: Simple & PowerfulYour 2012 Marketing Plan: Simple & Powerful
Your 2012 Marketing Plan: Simple & Powerful
Infusionsoft
 

En vedette (20)

Up to Speed on HTML 5 and CSS 3
Up to Speed on HTML 5 and CSS 3Up to Speed on HTML 5 and CSS 3
Up to Speed on HTML 5 and CSS 3
 
Javascript and Jquery: The connection between
Javascript and Jquery: The connection betweenJavascript and Jquery: The connection between
Javascript and Jquery: The connection between
 
Sql server 2012 ha dr
Sql server 2012 ha drSql server 2012 ha dr
Sql server 2012 ha dr
 
009 sql server management studio
009 sql server management studio009 sql server management studio
009 sql server management studio
 
ASP.NET Core deployment options
ASP.NET Core deployment optionsASP.NET Core deployment options
ASP.NET Core deployment options
 
OOPs fundamentals session for freshers in my office (Aug 5, 13)
OOPs fundamentals session for freshers in my office (Aug 5, 13)OOPs fundamentals session for freshers in my office (Aug 5, 13)
OOPs fundamentals session for freshers in my office (Aug 5, 13)
 
.Net framework architecture
.Net framework architecture.Net framework architecture
.Net framework architecture
 
Back to the Basics - 1 - Introduction to Web Development
Back to the Basics - 1 - Introduction to Web DevelopmentBack to the Basics - 1 - Introduction to Web Development
Back to the Basics - 1 - Introduction to Web Development
 
ASP.NET OVERVIEW
ASP.NET OVERVIEWASP.NET OVERVIEW
ASP.NET OVERVIEW
 
Future Web Trends - at Innovation series with Jimmy Wales
Future Web Trends - at Innovation series with Jimmy WalesFuture Web Trends - at Innovation series with Jimmy Wales
Future Web Trends - at Innovation series with Jimmy Wales
 
Your 2012 Marketing Plan: Simple & Powerful
Your 2012 Marketing Plan: Simple & PowerfulYour 2012 Marketing Plan: Simple & Powerful
Your 2012 Marketing Plan: Simple & Powerful
 
HTML 5 Overview
HTML 5 OverviewHTML 5 Overview
HTML 5 Overview
 
Asp.net page lifecycle
Asp.net page lifecycleAsp.net page lifecycle
Asp.net page lifecycle
 
HTML 5
HTML 5HTML 5
HTML 5
 
HTML 5 & CSS 3
HTML 5 & CSS 3HTML 5 & CSS 3
HTML 5 & CSS 3
 
OOP with C#
OOP with C#OOP with C#
OOP with C#
 
Introduction To Website Development
Introduction To Website DevelopmentIntroduction To Website Development
Introduction To Website Development
 
CMS 120: Introduction to Building a Website
CMS 120: Introduction to Building a WebsiteCMS 120: Introduction to Building a Website
CMS 120: Introduction to Building a Website
 
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
 
Gears and HTML 5 @media Ajax London 2008
Gears and HTML 5 @media Ajax London 2008Gears and HTML 5 @media Ajax London 2008
Gears and HTML 5 @media Ajax London 2008
 

Similaire à C# fundamentals Part 2

2.overview of c#
2.overview of c#2.overview of c#
2.overview of c#
Raghu nath
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statements
CtOlaf
 
Presentation on overloading
Presentation on overloading Presentation on overloading
Presentation on overloading
Charndeep Sekhon
 

Similaire à C# fundamentals Part 2 (20)

C# Fundamentals - Basics of OOPS - Part 2
C# Fundamentals - Basics of OOPS - Part 2C# Fundamentals - Basics of OOPS - Part 2
C# Fundamentals - Basics of OOPS - Part 2
 
2.overview of c#
2.overview of c#2.overview of c#
2.overview of c#
 
Operators In Java Part - 8
Operators In Java Part - 8Operators In Java Part - 8
Operators In Java Part - 8
 
Computer programming 2 Lesson 7
Computer programming 2  Lesson 7Computer programming 2  Lesson 7
Computer programming 2 Lesson 7
 
Constructor and destructors
Constructor and destructorsConstructor and destructors
Constructor and destructors
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
Java unit1 b- Java Operators to Methods
Java  unit1 b- Java Operators to MethodsJava  unit1 b- Java Operators to Methods
Java unit1 b- Java Operators to Methods
 
11operator in c#
11operator in c#11operator in c#
11operator in c#
 
Operators and it's type
Operators and it's type Operators and it's type
Operators and it's type
 
Programming presentation
Programming presentationProgramming presentation
Programming presentation
 
Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Coper in C
Coper in CCoper in C
Coper in C
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statements
 
Operators in C/C++
Operators in C/C++Operators in C/C++
Operators in C/C++
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
Operators in C++
Operators in C++Operators in C++
Operators in C++
 
Session 06 - Java Basics
Session 06 - Java BasicsSession 06 - Java Basics
Session 06 - Java Basics
 
Presentation on overloading
Presentation on overloading Presentation on overloading
Presentation on overloading
 

Plus de iFour Institute - Sustainable Learning

Plus de iFour Institute - Sustainable Learning (11)

Project Management : Project Planning by iFour Technolab Pvt. Ltd.
Project Management : Project Planning by iFour Technolab Pvt. Ltd.Project Management : Project Planning by iFour Technolab Pvt. Ltd.
Project Management : Project Planning by iFour Technolab Pvt. Ltd.
 
Project management : Project Monitoring and Control by iFour Technolab Pvt. Ltd.
Project management : Project Monitoring and Control by iFour Technolab Pvt. Ltd.Project management : Project Monitoring and Control by iFour Technolab Pvt. Ltd.
Project management : Project Monitoring and Control by iFour Technolab Pvt. Ltd.
 
Project management : Causal analysis and Resolution by iFour Technolab Pvt. ...
Project management :  Causal analysis and Resolution by iFour Technolab Pvt. ...Project management :  Causal analysis and Resolution by iFour Technolab Pvt. ...
Project management : Causal analysis and Resolution by iFour Technolab Pvt. ...
 
Here are proven techniques to Organizing effective training by iFour Technola...
Here are proven techniques to Organizing effective training by iFour Technola...Here are proven techniques to Organizing effective training by iFour Technola...
Here are proven techniques to Organizing effective training by iFour Technola...
 
ADO.NET by ASP.NET Development Company in india
ADO.NET by ASP.NET  Development Company in indiaADO.NET by ASP.NET  Development Company in india
ADO.NET by ASP.NET Development Company in india
 
Web API with ASP.NET MVC by Software development company in india
Web API with ASP.NET  MVC  by Software development company in indiaWeb API with ASP.NET  MVC  by Software development company in india
Web API with ASP.NET MVC by Software development company in india
 
jQuery plugins & JSON
jQuery plugins & JSONjQuery plugins & JSON
jQuery plugins & JSON
 
Mvc by asp.net development company in india - part 2
Mvc by asp.net development company in india  - part 2Mvc by asp.net development company in india  - part 2
Mvc by asp.net development company in india - part 2
 
jQuery for web development
jQuery for web developmentjQuery for web development
jQuery for web development
 
Cascading style sheets - CSS
Cascading style sheets - CSSCascading style sheets - CSS
Cascading style sheets - CSS
 
HTML Basics by software development company india
HTML Basics by software development company indiaHTML Basics by software development company india
HTML Basics by software development company india
 

Dernier

Dernier (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

C# fundamentals Part 2

  • 2.  Operators  Control statements  Access Modifiers INDEX http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 3. It is a symbol that tells the compiler to perform specific mathematical or logical manipulations. C# has rich set of built-in operators and provides the following types of operators • Arithmetic Operators • Relational Operators • Logical Operators • Bitwise Operators • Assignment Operators • Misc Operators Operators http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 4. Arithmetic Operators Operators (cont.) Operator Description Example(A=10,B=20) + Adds two operands A + B = 30 - Subtracts second operand from the first A - B = -10 * Multiplies both operands A * B = 200 / Divides numerator by de-numerator B / A = 2 % Modulus Operator and remainder of after an integer division B % A = 0 ++ Increment operator increases integer value by one A++ = 11 -- Decrement operator decreases integer value by one A-- = 9 http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 5. Relational Operators Operators (cont.) Operator Description Example(A=10,B=20) == Checks if the values of two operands are equal or not, if yes then condition becomes true (A == B) is not true. != Checks if the values of two operands are equal or not, if values are not equal then condition becomes true (A != B) is true > Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true (A > B) is not true < Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true (A < B) is true >= Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true (A >= B) is not true <= Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true (A <= B) is true http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 6. Logical Operators Operators (cont.) Operator Description Example (A=true,B=false) && Called Logical AND operator. If both the operands are non zero then condition becomes true (A && B) is false || Called Logical OR Operator. If any of the two operands is non zero then condition becomes true (A || B) is true ! Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true then Logical NOT operator will make false !(A && B) is true http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 7. Bitwise Operators Operators (cont.) Operator Description Example (A=60=00111100 B=13=0000 1101) & Binary AND Operator copies a bit to the result if it exists in both operands (A & B) = 12, 00001100 | Binary OR Operator copies a bit if it exists in either operand (A | B) = 61, 0011 1101 ^ Binary XOR Operator copies the bit if it is set in one operand but not both (A ^ B) = 49, 00110001 ~ Binary Ones Complement Operator is unary and has the effect of 'flipping' bits (~A ) = 61, which is 1100 0011 << Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand A << 2 = 240, which is 1111 0000 >> Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand A >> 2 = 15, which is 0000 1111 http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 8. Assignment Operators Operators (cont.) Operator Description Example = Binary AND Operator copies a bit to the result if it exists in both operands. C = A + B assigns value of A + B into C += Add AND assignment operator, It adds right operand to the left operand and assign the result to left operand C += A is equivalent to C = C + A -= Subtract AND assignment operator, It subtracts right operand from the left operand and assign the result to left operand C-=A is equivalent to C=C- A *= Multiply AND assignment operator, It multiplies right operand with the left operand and assign the result to left operand C *= A is equivalent to C = C * A /= Divide AND assignment operator, It divides left operand with the right operand and assign the result to left operand C /= A is equivalent to C = C / A %= Modulus AND assignment operator, It takes modulus using two operands and assign the result to left operand C %= A is equivalent to C = C % A http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 9. Assignment Operators Operators (cont.) Operator Description Example <<= Left shift AND assignment operator C <<= 2 is same as C = C << 2 >>= Right shift AND assignment operator C >>= 2 is same as C = C >> 2 &= Bitwise AND assignment operator C &= 2 is same as C = C & 2 ^= bitwise exclusive OR and assignment operator C ^= 2 is same as C = C ^ 2 %= bitwise inclusive OR and assignment operator C |= 2 is same as C = C | 2 http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 10. Statement that determines whether other statements will be executed • if statement decides whether to execute another statement, or decides which of two statements to execute • If -else :If the boolean expression evaluates to true, then the if block of code is executed, otherwise else block of code is executed • A switch statement decides which of several statements to execute • for loops are (typically) used to execute the controlled statement a given number of times. • The foreach statement repeats a group of embedded statements for each element in an array or an object collection that implements • while loops test whether a condition is true before executing the controlled statement • do-while loops test whether a condition is true after executing the controlled statement Control statements http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 11. Public • The public keyword is an access modifier for types and type members. Public access is the most permissive access level • Accessibility: • Can be accessed by objects of the class • Can be accessed by derived classes Private • Private members are accessible only within the body of the class or the struct in which they are declared • Accessibility: • Cannot be accessed by object • Cannot be accessed by derived classes Access Modifiers http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 12. Protected • A protected member is accessible from within the class in which it is declared, and from within any class derived from the class that declared this member • Accessibility: • Cannot be accessed by object • By derived classes Internal • Access modifier for types and type members. We can declare a class as internal or its member as internal. Internal members are accessible only within files in the same assembly • Access is limited exclusively to classes defined within the current project assembly Access Modifiers http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 13. • Accessibility: • In same assembly (public) • Can be accessed by objects of the class • Can be accessed by derived classes • In other assembly (internal) • Cannot be accessed by object • Cannot be accessed by derived classes Protected Internal • The protected internal accessibility means protected OR internal, not protected AND internal • In other words, a protected internal member is accessible from any class in the same assembly, including derived classes Access Modifiers http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India

Notes de l'éditeur

  1. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  2. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  3. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  4. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  5. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  6. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  7. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  8. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  9. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  10. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  11. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  12. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  13. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  14. Software Outsourcing Company India - http://www.ifourtechnolab.com/