0% found this document useful (0 votes)
3 views

4_Classes

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

4_Classes

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 52

Notepad Open Dialog

Snapshot

CLASS
State
• Selected
• Unselected
• Enabled
• Disabled

Collection Behaviour
of objects • Select
• Click
• Double click
TASK # 62 – C# object and Class Example p
Type the code Execute Discuss Worksho
Try renaming the class  Notice the Confirmation Dialog --> Discuss
TASK # 63 – Having main() in another class p
Type the code Execute Discuss Worksho

Trying replacing
“public” with “private”
 Discuss the error
TASK # 64 – Initialize and Display data through method p
Type the code Execute Discuss Worksho
TASK # 65 – Store and Display Employee Information p
Type the code Execute Discuss Worksho
TASK # 66 – Default Constructor – Having main() within the same class p
Type the code Execute Discuss Worksho
TASK # 67 – Default Constructor – Having main() within another class p
Type the code Execute Discuss Worksho
TASK # 67 – parameterized Constructor p
Type the code Execute Discuss Worksho
TASK # 68 – this keyword p
Type the code Execute Discuss Worksho

e re , “ this”
H fers
o rd r e
keyw ld s of
e fi e
to th
rr e n t class
cu
TASK # 69– using STATIC keyword Workshop
Type the code Execute Discuss
TASK # 70– using STATIC keyword Workshop
Type the code Execute Discuss
TASK # 71– Static Class Workshop
Type the code Execute Discuss
TASK # 72– Struct in C# Workshop
Type the code Execute Discuss
TASK # 74– ENUM Workshop
Type the code Execute Discuss
TASK # 75 - Properties Workshop
Type the code Execute Discuss
Private field
“name”

Public property
“Name”

“get” accessor

“set” accessor
TASK # 76– Single Level Inheritance – Inheriting fields Workshop
Type the code Execute Discuss
TASK # 77– Single Level Inheritance – Inheriting methods Workshop
Type the code Execute Discuss
TASK # 78– Multilevel Inheritance Workshop
Type the code Execute Discuss

Multiple
Inheritance is
not supported
in C# through
class
TASK # 79–
Make a program based on the diagram given below :
Add sample values and display them.
TASK # 80– Method Overloading(By changing number of arguments) Workshop
Type the code Execute Discuss
TASK # 81– Method Overloading(By changing data types of arguments) Workshop
Type the code Execute Discuss
TASK # 82– Workshop
Type the code Execute Discuss
TASK # 83– Accessing Base class property from Child class using “Base” Workshop
Type the code Execute Discuss
TASK # 84– Calling base class method from Child class using “Base” keyword Workshop
Type the code Execute Discuss

While calling base class


method, it is useful if base
and derived classes define
same method, meaning,
method is OVERRIDDEN

If derived class doesn't


define same method, there
is no need to use base
keyword.
TASK # 85– Illustrating automatic calling of the base class constructor Workshop
Type the code Execute Discuss
TASK # 86– Runtime Polymorphism Workshop
Type the code Execute Discuss
TASK # 87– Runtime Polymorphism – Having two derived classes Workshop
Type the code Execute Discuss

You might also like