Notes – Object Based vs Object Oriented Programming Language
Both Object-Oriented and Object-Based languages use the concept of objects, but they differ in features and capabilities.
Letโs break this down in a simple way.
Object-Oriented Programming Language (OOP)
- Fully supports objects and classes.
- Implements all four OOP principles:
- Encapsulation
- Inheritance
- Polymorphism
- Abstraction
- Example: Java, C++, Python, C#
Java Example:
class Animal {
void sound() {
System.out.println("Makes sound");
}
}
Object-Based Programming Language
- Supports objects, but does not support all OOP features (mainly inheritance and polymorphism).
- Limited version of OOP.
- Focuses only on encapsulation using objects.
- Example: JavaScript (before ES6), VBScript
JavaScript Example:
let car = {
brand: "Toyota",
drive: function() {
console.log("Car is moving");
}
};
Key Differences: Comparison Table
| Feature | Object-Oriented (OOP) | Object-Based |
|---|---|---|
| Supports Inheritance | Yes | No |
| Supports Polymorphism | Yes | No |
| Supports Abstraction | Yes | Limited or No |
| Class-based | Yes (e.g., Java) | No classes (older JS) |
| Examples | Java, C++, Python | JavaScript (old), VBScript |
| Object Usage | Full-fledged OOP objects | Basic object structures |
