返回列表 發帖
  1. package  顏詢大笨蛋1;


  2. import java.util.Scanner;
  3. public class  顏詢大笨蛋2 {

  4.         // 一個專案只會有一個(程式進入點)
  5.         public static void main(String[] args){
  6.                int a =10;
  7.                Car truck =new Car();
  8.                truck.carName="";
  9.                truck.wheels=8;
  10.                truck.people=3;
  11.                system.out.printf ("%s有%b",truck.carname,truck.wheel,truck.people);
  12.                Car bus =new Car();
  13.                truck.carName=" 巴士";
  14.                truck.wheels=6;
  15.                truck.people=40;
  16.                system.out.printf ("%s有%b",taxi.carname,taxi.wheel,taxi.people);
  17.                Car taxi =new Car();
  18.                truck.carName="計程車 ";
  19.                truck.wheels=4;
  20.                truck.people=5;
  21.         }               
  22. }
複製代碼

TOP

返回列表