Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Cars {
- String car_name;
- int car_year;
- }
- public class Program {
- public static void main(String[] args) {
- Cars car1 = new Cars();
- car1.car_name = "Porshe";
- car1.car_year = 2017;
- Cars car2 = new Cars();
- car2.car_name = "Mercedes";
- car2.car_year = 2018;
- System.out.println(car1.car_name + " from " + car1.car_year);
- System.out.println(car2.car_name + " from " + car2.car_year);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement