Java - Object-Oriented Programming Concepts
Consider this Java OOP code:
What is the output?
class Car {
int speed = 0;
void accelerate() { speed += 10; }
}
Car myCar = new Car();
myCar.accelerate();
System.out.println(myCar.speed);What is the output?
