الرجوع
تسجيل الدخول

What is the output of the above code?

public class Vehicle {
    private int speed;

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public int getSpeed() {
        return speed;
    }
}

public class Test {
    public static void main(String[] args) {
        Vehicle car = new Vehicle();
        car.setSpeed(100);
        System.out.println(car.getSpeed());
    }
}