whats object oriented programming code example
Example 1: oop principles
Abstraction (Partial Abstraction & Interfaces)
Encapsulation (Private Field & Getter & Setter)
Inheritance (Super and Sub Class)
Polymorphism (Static - Overloading & Dynanmic - Overriding)
Example 2: object oriented programming languages
Object oriented programming languages include:
Java
JavaScript
Python
C++
Visual Basic .NET
Ruby
Scala
PHP
These are just the main ones, there's much more out there.
Example 3: object oriented programming
public class Car
{
private double speed;
public Car(double initialSpeed)
{
speed = initialSpeed;
}
public double getSpeed()
{
return speed;
}
public void accelerate()
{
speed++;
}
public void slowDown()
{
speed--;
}
}