@@ -0,0 +1,2643 @@
+package thirty_days_of_code;%0D%0A%0D%0Aimport java.util.Scanner;%0D%0A%0D%0A/*%0D%0A * Problem Statement:%0D%0A * An abstract class is a class that cannot be instantiated, meaning you cannot%0D%0A * create a new instance of it. Attempting to instantiate an abstract class%0D%0A * (such as abstract class Book, provided for you in the editor) like so:%0D%0A * %0D%0A * Book new_novel=new Book(%22The Alchemist%22,%22Paulo Coelho%22);%0D%0A * results in error: Book is abstract; cannot be instantiated. This type of%0D%0A * class is only meant to serve as a base or blueprint for connecting the%0D%0A * subclasses that inherit it.%0D%0A * %0D%0A * To use an abstract class, you must create its subclass and then instantiate%0D%0A * the subclass. Any abstract methods declared in the abstract class (such as%0D%0A * abstract void display() in abstract class Book) must be implemented by the%0D%0A * subclass.%0D%0A * %0D%0A * In the editor we have provided the abstract Book class and a Solution class.%0D%0A * In the Solution class we created instance of a class called MyBook. Your task%0D%0A * is to write just the MyBook class. The class MyBook mustn't be public.%0D%0A * %0D%0A * Input Format: %0D%0A * Input from STDIN is already handled in the code given in the editor. MyBook's%0D%0A * constructor must have the following parameters: String title, String author,%0D%0A * and int price.%0D%0A * %0D%0A * Output Format: %0D%0A * The void display() method should print and label the respective title,%0D%0A * author, and price of the book's instance (with each value on its own line)%0D%0A * like so:%0D%0A * %0D%0A * Title: $title%0D%0A * Author: $author%0D%0A * Price: $price%0D%0A * Note: The $ is prepended to variable names to indicate they are placeholders%0D%0A * for variables.%0D%0A * %0D%0A * Sample Input: %0D%0A * The Alchemist%0D%0A * Paulo Coelho%0D%0A * 248%0D%0A * %0D%0A * Sample Output: %0D%0A * Title: The Alchemist%0D%0A * Author: Paulo Coelho%0D%0A * Price: 248%0D%0A */%0D%0Apublic class AbstractClasses %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09Scanner sc = new Scanner(System.in);%0D%0A%09%09String title = sc.nextLine();%0D%0A%09%09String author = sc.nextLine();%0D%0A%09%09int price = sc.nextInt();%0D%0A%09%09Book new_novel = new MyBook(title, author, price);%0D%0A%09%09new_novel.display();%0D%0A%09%09sc.close();%0D%0A%09%7D%0D%0A%7D%0D%0A%0D%0Aclass MyBook extends Book %7B%0D%0A    %0D%0A    private int price;%0D%0A    %0D%0A    public MyBook(String title, String author, int price) %7B%0D%0A        super(title, author);%0D%0A        this.price = price;%0D%0A    %7D%0D%0A    %0D%0A    public void display() %7B%0D%0A        System.out.println(%22Title: %22 + title);%0D%0A        System.out.println(%22Author: %22 + author);%0D%0A        System.out.println(%22Price: %22 + price);%0D%0A    %7D%0D%0A%7D%0D%0A%0D%0Aabstract class Book %7B%0D%0A%09String title;%0D%0A%09String author;%0D%0A%0D%0A%09Book(String t, String a) %7B%0D%0A%09%09title = t;%0D%0A%09%09author = a;%0D%0A%09%7D%0D%0A%0D%0A%09abstract void display();%0D%0A%7D

Add AbstractClasses