扩展抽象类
import java.util.*;//NowJava.com - 时 代 Java abstract class Book { String title; String author; Book(String t,String a){ title=t; author=a; } abstract void display(); /** 时 代 J a v a - nowjava.com **/ } class MyBook extends Book{ String title; String author; int price; MyBook(String t,String a,int p){ super(t,a); this.title=t; this.author=a; this.price=p; } void display(){ System.out.println("Title: "+title); System.out.println("Author: "+author); System.out.println("Price: "+price); } } public class Main{ public static void main(String []args) { Scanner sc=new Scanner(System.in); String title=sc.nextLine();