Java实验题3_7_林大锐格平台
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Java实验题3_7_林大锐格平台相关的知识,希望对你有一定的参考价值。
import java.util.Scanner; abstract class Vehicle { String wheels; abstract String noOfWheels(String a); void showWheels(){ System.out.println(wheels+" wheel vehicle"); } //write your own codes } class Car extends Vehicle { public String noOfWheels(String a){ wheels=a; return a; } //write your own codes } class Motorbike extends Vehicle { public String noOfWheels(String a){ wheels=a; return a; } //write your own codes } public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); Car ca=new Car();Motorbike mo=new Motorbike(); ca.noOfWheels(sc.next()); mo.noOfWheels(sc.next()); ca.showWheels(); mo.showWheels(); //write your own codes } }
以上是关于Java实验题3_7_林大锐格平台的主要内容,如果未能解决你的问题,请参考以下文章