Java/Java_02_Classes.java
<filename>Java/Java_02_Classes.java/** * * * * * * * * * * * * * * * * * * * * * * * **
 *           Java Pocket Card 02 Classes           *
 *                                                 *
 *              Yoann AMAR ASSOULINE               *
 *                                                 *
 ** * * * * * * * * * * * * * * * * * * * * * * * **/

/**
 * Java Classes
 * 🪙 Every file can only have one public class (i.e., a class with a public access modifier)
 */

public class Java_02_Classes {

    public static void Main (String[] args) {

    }


}


class Vehicles {

    /**
     * Class Properties
     */
    public static final String OBJECT_TYPE = "Vehicle"; 

    /**
     * Instance Properties
     */
    private String vehicleName; 
    private String vehicleType; 
    private int vehicleWheels; 
    private float vehicleMaxSpeed; 


    /**
     *  Classes Constructors
     *  🪙 Any class should have at least one constructor 
     *  🪙 Constructor overloading is when a class has multiple constructors with different parameters (numbers & data type) 
     *  🪙 By design, Java doesn't support optional parameters
     */
    public Vehicles () {

        this.vehicleName = "Test Vehicle"; 
        this.vehicleType = "Car"; 
        this.vehicleWheels = 4; 
        this.vehicleMaxSpeed = 250.0f; 

    }

    public Vehicles (String vehicleType, int vehicleWheels, float vehicleMaxSpeed) {

        this.vehicleType = vehicleType; 
        this.vehicleWheels = vehicleWheels; 
        this.vehicleMaxSpeed = vehicleMaxSpeed; 

    }

    /**
     * Instance Methods
     * 
     */
    
    public void startVehicle() {

    }
    
    public void stopVehicle () {

    }

    public void accelerate () {

    }

    public void brake () {

    }


    /**
     * Getters & Setters
     */
     public String getVehicleName () {
        return vehicleName; 
     }

     public void setVehicleName (String name) {
        this.vehicleName = name; 
     }

     public String getVehicleType () {
        return vehicleType; 
     }

     public void setVehicleType (String type) {
        this.vehicleType = type; 
     }

     public int getVehicleWheels () {
        return vehicleWheels;
     }

     public void setVehicleWheels (int wheels) {
        this.vehicleWheels = wheels; 
     }

     public float getVehicleMaxSpeed () {
        return vehicleMaxSpeed;
     }

     public void setVehicleMaxSpeed (float maxSpeed) {
        this.vehicleMaxSpeed = maxSpeed; 
     }


}




/**
 * Interfaces
 */
interface IClass {


}

class ImplementedClass implements IClass {

}




/**
 * Abstract & Concrete Classes
 */

abstract class Animal {

    void walk() {

    }

}


class Dog extends Animal {

    @Override
    public void walk() {

    }

    public String printState() {

        String message = "Test Message";

        /**
         * in main, you can use walk() method to invoke the overriding class.
         * But you can still use super.walk() to invoke the overridden class
         */
        walk() ;
        super.walk() ;

        return message;
    }

}

class Cat extends Animal {

    @Override
    public void walk() {

    }
}