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
PPTX
Huffman coding
PPTX
Huffman Coding Algorithm Presentation
PDF
regular expressions (Regex)
PPTX
Dag representation of basic blocks
PPTX
Huffman Algorithm By Shuhin
PPT
Human resource management assignment help
PDF
How doctors should think
ENUM - make u r names as data types
Huffman coding
Huffman Coding Algorithm Presentation
regular expressions (Regex)
Dag representation of basic blocks
Huffman Algorithm By Shuhin
Human resource management assignment help
How doctors should think

Viewers also liked (10)

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

Similar to Vb and c# (20)

PDF
Vb net1
PPTX
C sharp part 001
PPTX
CS4443 - Modern Programming Language - I Lecture (2)
PPTX
VB.NET Datatypes.pptx
DOCX
UNIT-II VISUAL BASIC.NET | BCA
PPTX
C Sharp Course 101.5
PPTX
Spf Chapter4 Variables
PPTX
How To Code in C#
PDF
C# Language Overview Part I
PPTX
CSharp Language Overview Part 1
PPT
Visual basic intoduction
PPT
PPTX
C# slid
PPTX
Keywords, identifiers and data type of vb.net
PPTX
Sharbani bhattacharya VB Structures
PPTX
C# overview part 1
PPTX
C# basics
PPTX
unit 1 (1).pptx
PPTX
Unit 1 introduction to visual basic programming
PPSX
DITEC - Programming with C#.NET
Vb net1
C sharp part 001
CS4443 - Modern Programming Language - I Lecture (2)
VB.NET Datatypes.pptx
UNIT-II VISUAL BASIC.NET | BCA
C Sharp Course 101.5
Spf Chapter4 Variables
How To Code in C#
C# Language Overview Part I
CSharp Language Overview Part 1
Visual basic intoduction
C# slid
Keywords, identifiers and data type of vb.net
Sharbani bhattacharya VB Structures
C# overview part 1
C# basics
unit 1 (1).pptx
Unit 1 introduction to visual basic programming
DITEC - Programming with C#.NET
Ad

More from nivlayalat (6)

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

Recently uploaded (20)

PDF
Computing-Curriculum for Schools in Ghana
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
HVAC Specification 2024 according to central public works department
PDF
Hazard Identification & Risk Assessment .pdf
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
Introduction to Building Materials
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Empowerment Technology for Senior High School Guide
PPTX
20th Century Theater, Methods, History.pptx
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PDF
My India Quiz Book_20210205121199924.pdf
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
Computing-Curriculum for Schools in Ghana
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
A powerpoint presentation on the Revised K-10 Science Shaping Paper
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
AI-driven educational solutions for real-life interventions in the Philippine...
Unit 4 Computer Architecture Multicore Processor.pptx
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
HVAC Specification 2024 according to central public works department
Hazard Identification & Risk Assessment .pdf
What if we spent less time fighting change, and more time building what’s rig...
Introduction to Building Materials
202450812 BayCHI UCSC-SV 20250812 v17.pptx
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Empowerment Technology for Senior High School Guide
20th Century Theater, Methods, History.pptx
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
My India Quiz Book_20210205121199924.pdf
LDMMIA Reiki Yoga Finals Review Spring Summer

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 +