Advertisement
sergAccount

Untitled

Aug 16th, 2020
1,049
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.85 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.spec;
  7.  
  8. import com.spec.model.Car;
  9.  
  10. public class Main {
  11.     //
  12.     public static void main(String[] args) {
  13.         // объявление переменной типа Car
  14.         //Ctrl+Shift+I
  15.         Car c1; // c1 - имя переменной, Car
  16.         // создание объекта типа Car
  17.         // для создания объекта используем ключевое слово new
  18.         c1 = new Car(); // new Car()
  19.         // объявляем переменную и присваиваем значение-объект данной переменной
  20.         Car c2 = new Car();
  21.        
  22.        
  23.     }    
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement