Advertisement
sergAccount

Untitled

Jul 10th, 2021
975
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.mycompany.ex17;
  7.  
  8. /**
  9.  *
  10.  * @author student
  11.  */
  12. public class Main2 {
  13.     //
  14.     public static void main(String[] args) {
  15.         //
  16.         Car c1 = new Car();
  17.         Car c2 = new Car("green");
  18.        
  19.         Car c3 = new Car("green", 2000);
  20. //        c1.m = 10;
  21. //        //
  22. //        System.out.println("c1.m=" + c1.m);
  23. //        c1.m = -10;
  24. //        System.out.println("c1.m=" + c1.m);
  25.        
  26.         // c1.speed
  27.         c1.setColor("red");
  28.        
  29.     }
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement