mirror of
https://github.com/Dichgrem/Java.git
synced 2025-12-16 20:42:00 -05:00
update:demo3
This commit is contained in:
20
com/study/demo3/Vehicle.java
Normal file
20
com/study/demo3/Vehicle.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.study.demo3;
|
||||
public class Vehicle {
|
||||
protected String name;
|
||||
|
||||
public Vehicle(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Vehicle() {
|
||||
this.name = "Unknown Vehicle";
|
||||
}
|
||||
|
||||
public void start() {
|
||||
System.out.println("Vehicle Start");
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
System.out.println("Vehicle Stop");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user