Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Car {
- public static void main(String [] args) {
- int doors;
- String carColor;
- String wheelsColor;
- String tiresColor;
- String brand;
- String model;
- }
- }
- public class CarShop {
- public static void main(String [] args) {
- Car audi = new Car();
- audi.brand = "Audi";
- audi.model = "A4";
- audi.doors = 4;
- audi.carColor = "Czarny";
- audi.wheelsColor = "Srebrny";
- audi.tiresColor = "Czarny";
- String audiInfo = audi.brand + " " + audi.model
- + ", Drzwi: " + audi.doors
- + ", Kolor nadwozia: " + audi.carColor
- + ", Kolor felg: " + audi.wheelsColor
- + ", Kolor opon: " + audi.tiresColor;
- System.out.println("Wybrales nastepujacy samochod: ");
- System.out.println(audi.info);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment