So here, Car is the class, and wheels, speed limits, mileage are their properties.ĭata abstraction is one of the most essential and important features of object-oriented programming. There may be many cars with different names and brands but all of them will share some common properties like all of them will have 4 wheels, Speed Limit, Mileage range, etc. A class is like a blueprint for an object.įor Example: Consider the Class of Cars. It represents the set of properties or methods that are common to all objects of one type. It consists of data members and member functions, which can be accessed and used by creating an instance of that class.
EXAMPLE OF VISUAL BASIC PROGRAMMING LANGUAGE CODE
The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.Ī class is a user-defined data type. Object-oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism, etc in programming. What Should I Do?Īs the name suggests, Object-Oriented Programming or OOPs refers to languages that use objects in programming.