Advertisement
sergAccount

Untitled

Jan 31st, 2021
967
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 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.ja7;
  7.  
  8. public class Car {
  9.     // свойства
  10.     // цвет, масса, текущая скорость авто
  11.     // цвет
  12.     private String color;
  13.     // масса
  14.     private double m;
  15.     //текущая скорость авто
  16.     private double speed;        
  17.     // методы
  18.     // get, set - методы
  19.     // get
  20.     public String getColor(){
  21.         return color;
  22.     }
  23.     // Alt+Insert
  24.     public double getM() {
  25.         return m;
  26.     }
  27.     public double getSpeed() {
  28.         return speed;
  29.     }    
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement