Download presentation
Presentation is loading. Please wait.
Published byCornelius Bell Modified over 9 years ago
6
A class is a collection of things which posses common similarities. In C#.NET a class is a user defined Data type and is Known as Reference Type. A class can contain following members in C#.NET A class is a collection of things which posses common similarities. In C#.NET a class is a user defined Data type and is Known as Reference Type. A class can contain following members in C#.NET
14
Class ConDemo { ConDemo () { Console.WriteLine (“Constructor”); } Void Demo () { Console.writeLine (“Method”); } Static VoidMain () { ConDemo cd1=new ConDemo (); ConDemo cd2=new ConDemo (); ConDemo cd3=cd2; Cd1.Demo (); cd2.Demo (); cd3.demo (); Console.ReadLine (); }
15
1 2 2
18
The process creating a new class form already existing class. Existing class is known as Parent Class or Base Class. New class is known as Child Class or Derived Class. Child class will get all the features of parent class Code Reusability and providing additional functionalities
19
[ ] class : Class Class1 { Members } Class Class2 : Class1 { Consume the parent members here }
26
1
27
Access Modifier Data Type property Name { set { Data Field Name=Value; } get { return data Field Name; }
28
Public int PEAge { set { EAge=Value; } get { return EAge; } Class ClsProperty1 { Static void Main(string[] args) { clsEmployee obj1=new clsEmployee(); Console.write(“Enter Employee details:”); Obj1.PEmpId=Concert.ToInt32(Console.ReadLine()); Obj1.PEAge=convert.ToInt32(console.ReadLine()); }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.