<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/**
 * Car class
 *
 * Used for the Real Python OOP in Java vs Python article
 *
 * Requires both Vehicle.java and Device.java
 */

public class Carro extends Vehiculo implements Dispositivo {

   private int anio; // Year of our car
   private int voltaje; // Battery voltage
   private static int ruedas; // How many wheels do we have

   /**
    * Car constructor
    */
   public Carro(String color, String modelo, int anio) {
      super(color, modelo);
      this.anio = anio;
      this.voltaje = 12;
   }

   /**
    * Override the interface method.
    */
   @Override
   public int getVoltaje() {
      return voltaje;
   }

   /**
    * getYear returns the Car's year
    */
   public int getanio() {
      return anio;
   }

   /**
    * setYear changes Car's year
    */
   public void setanio(int anio) {
      this.anio = anio;
   }

   /**
    * getWheels returns the number of wheels
    */
   public static int getRuedas() {
      return ruedas;
   }

   /**
    * setWheels sets the number wheels
    */
   public static void setRuedfas(int count) {
      ruedas = count;
   }

   /**
    * Return a human readable string reoresenting the Car
    */
   public String toString() {
      return "Carro: " + getColor() + " : " + getModelo() + " : " + getanio();
   }
}
</pre></body></html>