Skip to content

umernadim/oops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📘 C# Classes and Objects Practice

This project demonstrates the fundamental and intermediate concepts of Object-Oriented Programming (OOP) in C#. It covers creating classes, defining fields, using constructors, initializing objects, applying methods, and implementing method overloading.

🧠 Concepts Covered

  • Creating Classes and Objects
  • Object Initialization (two methods)
  • Using Fields and Methods
  • Working with Lists of Objects
  • Constructors and Parameterized Constructors
  • Method Overloading
  • Combining Classes with Loops and Conditions

🧩 Task Overview

1. Creating a Simple Class (Person Class)

Goal: Understand how to define a class with properties and initialize an object using both:

  • Default constructor + property assignment.
  • Object initializer syntax.

2. Bottle Class Example

Goal: Learn to create simple classes with properties and display object data.

3. Class with a Method (Calculator Class)

Goal: Understand how to define and call methods inside a class.

4. List of Objects (Mobile Class Example)

Goal: Practice creating and iterating over a list of custom objects.

🏗️ Constructors

5. Parameterized Constructor (Toyota Class)

Goal: Learn to use constructors for initializing class data.

6. Creating List of Objects Using Constructor (Student Class)

Goal: Learn to instantiate multiple objects dynamically using constructors.

7. Product List with Constructor

Goal: Practice constructors with multiple parameters and lists.

8. Student Marks Average Calculator

Goal: Combine constructors and methods for data calculation.

9. Employee Salary Calculator

Goal: Demonstrate class methods and business logic inside constructors.

🔄 Method Overloading

10. Suzuki Car Example

Goal: Learn how method and constructor overloading allow multiple ways to create objects.

🧾 Summary

Concept Description
Class Blueprint for creating objects.
Object Instance of a class containing real data.
Constructor Initializes an object’s data when created.
Method Performs an action using object data.
Overloading Multiple constructors or methods with different parameters.
List of Objects Used to manage multiple instances efficiently.

🏁 Conclusion

Through these exercises, you’ve practiced:

  • Declaring and using classes and objects.
  • Creating constructors and understanding their purpose.
  • Working with lists of custom objects.
  • Using methods and method overloading effectively.

These tasks form the foundation of Object-Oriented Programming (OOP) in C# and are essential for building scalable applications.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages