SlideShare a Scribd company logo
V B . N ET Comme nts C #
' Single line only
REM Single line only
''' <summary>XML
comments</summary>
// Single line
/* Multiple
line */
/// <summary>XML comments on single
line</summary>
/** <summary>XML comments on multiple
lines</summary> */
V B . N ET Da ta Type s C #
Value Types
Boolean
Byte, SByte
Char
Short, UShort, Integer, UInteger,
Long, ULong
Single, Double
Decimal
Date (alias of System.DateTime)
structures
enumerations
Reference Types
Object
String
arrays
delegates
Initializing
Dim correct As Boolean = True
Dim b As Byte = &H2A 'hex or
&O52 for octal
Dim person As Object = Nothing
Dim name As String = "Dwight"
Dim grade As Char = "B"c
Dim today As Date = #12/31/2010
12:15:00 PM#
Dim amount As Decimal = 35.99@
Dim gpa As Single = 2.9!
Dim pi As Double = 3.14159265
Dim lTotal As Long = 123456L
Dim sTotal As Short = 123S
Dim usTotal As UShort = 123US
Dim uiTotal As UInteger = 123UI
Dim ulTotal As ULong = 123UL
Value Types
bool
byte, sbyte
char
short, ushort, int, uint, long, ulong
float, double
decimal
DateTime (not a built-in C# type)
structs
enumerations
Reference Types
object
string
arrays
delegates
Initializing
bool correct = true;
byte b = 0x2A; // hex
object person = null;
string name = "Dwight";
char grade = 'B';
DateTime today = DateTime.Parse("12/31/2010
12:15:00 PM");
decimal amount = 35.99m;
float gpa = 2.9f;
double pi = 3.14159265; // or 3.14159265D
long lTotal = 123456L;
short sTotal = 123;
ushort usTotal = 123;
uint uiTotal = 123; // or 123U
ulong ulTotal = 123; // or 123UL
V B . N ET Cons ta nts C #
Const MAX_STUDENTS As Integer =
25
' Can set to a const or var; may be
initialized in a constructor
ReadOnly MIN_DIAMETER As Single
= 4.93
const int MAX_STUDENTS = 25;
// Can set to a const or var; may be initialized in
a constructor
readonly float MIN_DIAMETER = 4.93f;
V B . N ET Ope r a tor s C #
Comparison
= < > <= >= <>
Arithmetic
+ - * /
Mod
 (integer division)
^ (raise to a power)
Assignment
= += -
= *= /= = ^= <<= >>= &=
Bitwise
And Or Xor Not << >>
Logical
AndAlso OrElse And Or Xor No
t
Note: AndAlso and OrElse perform
short-circuit logical evaluations
String Concatenation
&
Comparison
== < > <= >= !=
Arithmetic
+ - * /
% (mod)
/ (integer division if both operands are ints)
Math.Pow(x, y)
Assignment
= += -
= *= /= %= &= |= ^= <<= >>= ++ -
-
Bitwise
& | ^ ~ << >>
Logical
&& || & | ^ !
Note: && and || perform short-circuit logical
evaluations
String Concatenation
+

More Related Content

PDF
ENUM - make u r names as data types
Ajay Chimmani
 
PPTX
Huffman coding
Nazmul Hyder
 
PPTX
Huffman Coding Algorithm Presentation
Akm Monir
 
PDF
regular expressions (Regex)
Rebaz Najeeb
 
PPTX
Dag representation of basic blocks
Jothi Lakshmi
 
PPTX
Huffman Algorithm By Shuhin
suhin4000
 
PPT
Human resource management assignment help
Mark Jack
 
PDF
How doctors should think
Eldred Taylor MD
 
ENUM - make u r names as data types
Ajay Chimmani
 
Huffman coding
Nazmul Hyder
 
Huffman Coding Algorithm Presentation
Akm Monir
 
regular expressions (Regex)
Rebaz Najeeb
 
Dag representation of basic blocks
Jothi Lakshmi
 
Huffman Algorithm By Shuhin
suhin4000
 
Human resource management assignment help
Mark Jack
 
How doctors should think
Eldred Taylor MD
 

Viewers also liked (10)

DOCX
Gel jornal
Magelle Recodo
 
PDF
Sopra Banking Compliance. Diagnostico de calidad de datos DPM.
Enrique Hermoso
 
PDF
Modul media pembelajaran
rijalwakatobi
 
PPT
Modeling low emissions development strategies
CIFOR-ICRAF
 
PDF
ACCA0001
Rana Haris
 
PDF
Concern Book Follow up Study
Shankor Paul
 
PPTX
Pertumbuhan hewan
hanan213
 
PDF
Queridos reyes magos,actividad para jugar con el Dibujo Técnico
Inma Contreras
 
PPT
Materials for Inlays, Onlays, Crowns and Bridges
chiseldental
 
PPTX
Foods to Eat in Uric Acid in Hindi Iयूरिक एसिड में क्या खाएI
Herbal Daily
 
Gel jornal
Magelle Recodo
 
Sopra Banking Compliance. Diagnostico de calidad de datos DPM.
Enrique Hermoso
 
Modul media pembelajaran
rijalwakatobi
 
Modeling low emissions development strategies
CIFOR-ICRAF
 
ACCA0001
Rana Haris
 
Concern Book Follow up Study
Shankor Paul
 
Pertumbuhan hewan
hanan213
 
Queridos reyes magos,actividad para jugar con el Dibujo Técnico
Inma Contreras
 
Materials for Inlays, Onlays, Crowns and Bridges
chiseldental
 
Foods to Eat in Uric Acid in Hindi Iयूरिक एसिड में क्या खाएI
Herbal Daily
 
Ad

Similar to Vb and c# (20)

PDF
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
GrejoJoby1
 
PPTX
Unit2_3.pptx Chapter 2 Introduction to C#
Priyanka Jadhav
 
PPTX
Object Oriented Design and Programming Unit-04
Sivakumar M
 
PDF
Cs211 module 1_2015
Saad Baig
 
PDF
Cs211 module 1_2015
Saad Baig
 
PPTX
verilog_tutorial1.pptx
SuyashMishra465104
 
PDF
C++ Topic 1.pdf from Yangon Technological University
ShweEainLinn2
 
PPTX
Programming in C by SONU KUMAR.pptx
SONU KUMAR
 
PPTX
Testing lecture after lec 4
emailharmeet
 
ODP
Open Gurukul Language PL/SQL
Open Gurukul
 
PPTX
Chapter1.pptx
WondimuBantihun1
 
PDF
Interactive Transmission System Computation Unit
mayankraj0805
 
PDF
VLSI System Verilog Notes with Coding Examples
Jason J Pulikkottil
 
PPTX
C# basics
sagaroceanic11
 
DOCX
VBS control structures for if do whilw.docx
Ramakrishna Reddy Bijjam
 
PPT
Digital System Design-Switchlevel and Behavioural Modeling
Indira Priyadarshini
 
ODP
Ppt of c vs c#
shubhra chauhan
 
PPTX
C language by Dr. D. R. Gholkar
PRAVIN GHOLKAR
 
PPTX
Chapter 2
application developer
 
PDF
UNIT1 PPS of C language for first year first semester
Aariz2
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
GrejoJoby1
 
Unit2_3.pptx Chapter 2 Introduction to C#
Priyanka Jadhav
 
Object Oriented Design and Programming Unit-04
Sivakumar M
 
Cs211 module 1_2015
Saad Baig
 
Cs211 module 1_2015
Saad Baig
 
verilog_tutorial1.pptx
SuyashMishra465104
 
C++ Topic 1.pdf from Yangon Technological University
ShweEainLinn2
 
Programming in C by SONU KUMAR.pptx
SONU KUMAR
 
Testing lecture after lec 4
emailharmeet
 
Open Gurukul Language PL/SQL
Open Gurukul
 
Chapter1.pptx
WondimuBantihun1
 
Interactive Transmission System Computation Unit
mayankraj0805
 
VLSI System Verilog Notes with Coding Examples
Jason J Pulikkottil
 
C# basics
sagaroceanic11
 
VBS control structures for if do whilw.docx
Ramakrishna Reddy Bijjam
 
Digital System Design-Switchlevel and Behavioural Modeling
Indira Priyadarshini
 
Ppt of c vs c#
shubhra chauhan
 
C language by Dr. D. R. Gholkar
PRAVIN GHOLKAR
 
UNIT1 PPS of C language for first year first semester
Aariz2
 
Ad

More from nivlayalat (6)

DOCX
Difference between microsoft excel 2007
nivlayalat
 
DOCX
Machine problems
nivlayalat
 
DOC
Figures of networks
nivlayalat
 
DOCX
Nup vacant positions
nivlayalat
 
DOCX
Algorithm
nivlayalat
 
DOCX
Vb and c#
nivlayalat
 
Difference between microsoft excel 2007
nivlayalat
 
Machine problems
nivlayalat
 
Figures of networks
nivlayalat
 
Nup vacant positions
nivlayalat
 
Algorithm
nivlayalat
 
Vb and c#
nivlayalat
 

Recently uploaded (20)

PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PPTX
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PPTX
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 

Vb and c#

  • 1. V B . N ET Comme nts C # ' Single line only REM Single line only ''' <summary>XML comments</summary> // Single line /* Multiple line */ /// <summary>XML comments on single line</summary> /** <summary>XML comments on multiple lines</summary> */ V B . N ET Da ta Type s C # Value Types Boolean Byte, SByte Char Short, UShort, Integer, UInteger, Long, ULong Single, Double Decimal Date (alias of System.DateTime) structures enumerations Reference Types Object String arrays delegates Initializing Dim correct As Boolean = True Dim b As Byte = &H2A 'hex or &O52 for octal Dim person As Object = Nothing Dim name As String = "Dwight" Dim grade As Char = "B"c Dim today As Date = #12/31/2010 12:15:00 PM# Dim amount As Decimal = 35.99@ Dim gpa As Single = 2.9! Dim pi As Double = 3.14159265 Dim lTotal As Long = 123456L Dim sTotal As Short = 123S Dim usTotal As UShort = 123US Dim uiTotal As UInteger = 123UI Dim ulTotal As ULong = 123UL Value Types bool byte, sbyte char short, ushort, int, uint, long, ulong float, double decimal DateTime (not a built-in C# type) structs enumerations Reference Types object string arrays delegates Initializing bool correct = true; byte b = 0x2A; // hex object person = null; string name = "Dwight"; char grade = 'B'; DateTime today = DateTime.Parse("12/31/2010 12:15:00 PM"); decimal amount = 35.99m; float gpa = 2.9f; double pi = 3.14159265; // or 3.14159265D long lTotal = 123456L; short sTotal = 123; ushort usTotal = 123; uint uiTotal = 123; // or 123U ulong ulTotal = 123; // or 123UL
  • 2. V B . N ET Cons ta nts C # Const MAX_STUDENTS As Integer = 25 ' Can set to a const or var; may be initialized in a constructor ReadOnly MIN_DIAMETER As Single = 4.93 const int MAX_STUDENTS = 25; // Can set to a const or var; may be initialized in a constructor readonly float MIN_DIAMETER = 4.93f; V B . N ET Ope r a tor s C # Comparison = < > <= >= <> Arithmetic + - * / Mod (integer division) ^ (raise to a power) Assignment = += - = *= /= = ^= <<= >>= &= Bitwise And Or Xor Not << >> Logical AndAlso OrElse And Or Xor No t Note: AndAlso and OrElse perform short-circuit logical evaluations String Concatenation & Comparison == < > <= >= != Arithmetic + - * / % (mod) / (integer division if both operands are ints) Math.Pow(x, y) Assignment = += - = *= /= %= &= |= ^= <<= >>= ++ - - Bitwise & | ^ ~ << >> Logical && || & | ^ ! Note: && and || perform short-circuit logical evaluations String Concatenation +