Preview:
public class Main {
    public static void main(String[] args) {

        Cars azatCar = new Cars("Mazda", "blue",2005);
        azatCar.brand = "Mazda" ;
        azatCar.year = 2005 ;
        azatCar.color = "blue" ;

        Cars someOtherCar = new Cars ("BMW", "black") ;
        someOtherCar.color = "black" ;
        someOtherCar.year = 2020 ;
        someOtherCar.brand = "BMW" ;

        System.out.println(someOtherCar.brand);
        azatCar.accelerate() ;
        azatCar.headlightsOn() ;
        azatCar.headlightsOff() ;
        System.out.println ("odometer is equal to " + azatCar.return0dometer(100000) + " miles");
    }
}
/* Output:
BMW
Car is accelerating
Car's headlights are on
Car's headlights are off
odometer is equal to 100000 miles
*/
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter