public class Main { public static void main (String[] args) { Cars azatFirstCar = new Cars(); azatFirstCar.brand = "Mazda" ; azatFirstCar.year = 2005 ; azatFirstCar.color = "blue" ; Cars azatSecondCar = new Cars () ; azatSecondCar.color = "black" ; azatSecondCar.year = 2020 ; azatSecondCar.brand = "BMW" ; System.out.println(azatFirstCar.brand); System.out.println(azatSecondCar.brand); } } /* Output: Mazda BMW */
Preview:
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