Total Page Preview:   000000000563

Explain difference between class and object in OOPS in English and Hindi

 

Difference between class and object in OOPS in English:

Class and Object are two fundamental concepts in Object-Oriented Programming (OOP) and are used to organize and structure code. Here are the differences between them in a table format:

Let's understand the differences between class and object with a C# example:

In this example, we have defined a Car class that contains two data members, a constructor, and a method. We have then created an object myCar of the Car class using the new keyword. We have accessed the properties and methods of the myCar object using the dot notation (.).
In summary, a class is a blueprint or template for creating objects, while an object is an instance of a class that has a specific state and behavior.
 
 
Difference between class and object in OOPS in Hindi:
Class aur object dono object-oriented programming (OOP) ke important concepts hai. Class ek blueprint hai, jis se objects create kiye jate hai. Ek class ke andar variables aur methods hote hai, jo objects ke behavior ko define karte hai.
Object ek instance hai, jise class ke blueprint ke according create kiya jata hai. Ek object me class ke variables aur methods ka copy hota hai. Is tarah se, ek class ke multiple objects create kiye ja sakte hai, jinhe alag-alag values assign kiye ja sakte hai.
 
 
Ye concepts object-oriented programming (OOP) ke important concepts hai. Inka use karke hum apne program ko modular, reusable aur scalable bana sakte hain.
Yaha ek C# example hai, jisme class aur object ka use kiya gaya hai:
 
 
Is example me humne Student class ko create kiya hai, jisme name aur rollNo variables hai, aur DisplayDetails() method hai, jo name aur rollNo ki values ko display karta hai.
Main() method me humne Student class ke student1 aur student2 objects create kiye hai. Humne name aur rollNo ki values ko set kiya hai aur DisplayDetails() method ko call kiya hai. Hum dekh sakte hai ki DisplayDetails() method me class ke variables ka use kiya ja raha hai, jinhe objects me assign kiya ja sakta hai.
Is tarah se, hum class ke blueprint se multiple objects create kar sakte hai, jinhe alag-alag values assign kiya ja sakta hai, aur unke behavior ko define kiya ja sakta hai.
 
 
 
 
 
 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: