JAVA程式語法_物件導向Part2_static關鍵字使用之便利_final關鍵字使用

static關鍵字使用之便利 各位還記得之前分享了 JAVA OOP 我們拿了 車子 來進行比喻 這次一樣 假設我們是一個顧車的人士 我們有很多台車子要顧 那由於我們顧車會需要得知許多車子各自的特性 哪一廠牌 哪一車款 總價多少 里程數多少 車子的持有人是誰 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package javaoop ; /** * * @author chous */ public class Car { //Properties String Type ; int Model ; double Price ; double Mileage ; String Owner ; public Car (){ } public Car ( String Type , int Model , double Price , double Mileage , String Owner ){ this . Type = Type ; this . Model = Model ; this . Price = Price ; this . Mileage = Mileage ; this . Owner = Owner ; } //Methods ...