Professional Documents
Culture Documents
Event Driven
10
Constants and Variables
12
Naming
Removing Method
remove one or more characters located anywhere in a string
returns a string with the appropriate characters removed
Syntax: string.Remove(startIndex, count) 26
String Manipulation
29
Methods and Their Types
32
Properties and Events
44
Inheritance and Polymorphism
Inheritance
Types of inheritance
• Single Inheritance Multilevel Inheritance
• Hierarchical Inheritance
• Hybrid
45
Inheritance and Polymorphism
Inheritance
Example: Car class (child) inherits from Vehicle class (parent)
class Vehicle // base class (parent) {
public string brand = "Ford"; // Vehicle field
public void honk() // Vehicle method {
Customer Class
48
Inheritance and Polymorphism
Polymorphism
poly means “Many,” and morph means “Forms”
• means “Many Forms”
allows you to create multiple methods with the same name
but different signatures in the same class or in derived
classes
49
Inheritance and Polymorphism
Polymorphism
Method Overloading
• has several names like “Compile Time Polymorphism” or
“Static Polymorphism”
• means creating multiple methods in a class with the same
54
Feb 11, 2024
The End!
Questions, Ambiguities,