public class Cars { 3 usages String brand ; 3 usages String color ; 3 usages int year ; 2 usages 2 related problems public Cars (String carBrand, String carColor, int carYear) { brand = carBrand; color = carColor; year } public void accelerate() { System.out.println("car is accelerating"); } public void headlightsOn() { System.out.println("car's headlights is on"); } public void headlightsOff() { System.out.println("car's headlights is off"); } }
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