- package 顏詢大笨蛋1;
- import java.util.Scanner;
- public class 顏詢大笨蛋2 {
- // 一個專案只會有一個(程式進入點)
- public static void main(String[] args){
- int a =10;
- Car truck =new Car();
- truck.carName="";
- truck.wheels=8;
- truck.people=3;
- system.out.printf ("%s有%b",truck.carname,truck.wheel,truck.people);
- Car bus =new Car();
- truck.carName=" 巴士";
- truck.wheels=6;
- truck.people=40;
- system.out.printf ("%s有%b",taxi.carname,taxi.wheel,taxi.people);
- Car taxi =new Car();
- truck.carName="計程車 ";
- truck.wheels=4;
- truck.people=5;
- }
- }
複製代碼 |