01 Type Casting, Variable Type, Class Object, Constructor
01 Type Casting, Variable Type, Class Object, Constructor
• C# Data Types
• Type Casting
• The keywords readonly and const
• Structures
• Enumeration
• String
• Use of params, ref, out
• Understand the concept of Class and Object
• Learn about constructors
• Variable Types
THE C# BASICS
Pass Value by
Reference
Pass Value by
Reference
#NB:
Namespace
can have
multiple class
inside
The first and second elements are the instance of class
Geeks1 and class Geeks2. The third element is a string and
the fourth element is a double value and the fifth element is
a null value. Here, string str = obj[j] as string; we are
using as operator to cast the object array as a string and
store result into the string str. After that, check for the
resultant value. If it is null then print the “element is not a
string” and if not null, then print the string.
Write a code with “is” operator to check whether type is correct
Write a code with struct so that we can save passport
Information such as: ID, Name, DOB, country etc.
Months.April will print 3
Class & Object
protected string name = "Sheeran";
• C# 4.0 The Complete Reference; Herbert Schildt; McGraw-Hill Osborne Media; 2010
• Head First C# by Andrew Stellman
• Fundamentals of Computer Programming with CSharp – Nakov v2013
References
C# 4.0 The Complete Reference; Herbert Schildt; McGraw-Hill Osborne Media; 2010