@@ -0,0 +1,2041 @@
+// From https://www.hackerrank.com/challenges/30-abstract-classes%0A// Task:%0A// Given a Book class and a Solution class, write a MyBook class that%0A// does the following:%0A//%0A// - Inherits from Book%0A// - Has a parameterized constructor taking these 3 parameters:%0A//    - string title%0A//    - string author%0A//    - int price%0A// - Implements the Book class' abstract display() method so%0A//   it prints these 3 lines:%0A//    - Title: , a space, and then the current instance's title.%0A//    - Author: , a space, and then the current instance's author.%0A//    - Price: , a space, and then the current instance's price.%0A// Note: Because these classes are being written in the same file,%0A// you must not use an access modifier (e.g.: )%0A// when declaring MyBook or your code will not execute.%0A//%0A// Input Format:%0A//%0A// You are not responsible for reading any input from stdin.%0A// The Solution class creates a Book object and calls the%0A// MyBook class constructor (passing it the necessary arguments).%0A// It then calls the display method on the Book object.%0A//%0A// Output Format:%0A//%0A// The void display() method should print and label the respective title,%0A// author, and price of the MyBook object's instance (with each value on its%0A// own line).%0A%0Aimport java.util.*;%0Aabstract class Book%0A%7B%0A    String title;%0A    String author;%0A    Book(String t,String a)%7B%0A        title=t;%0A        author=a;%0A    %7D%0A    abstract void display();%0A%0A%0A%7D%0A%0Aclass MyBook extends Book%7B%0A    int price;%0A%0A    MyBook(String title, String author, int price)%7B%0A        super(title, author);%0A        this.price = price;%0A    %7D%0A%0A    void display()%7B%0A        System.out.println(%22Title: %22 + title);%0A        System.out.println(%22Author: %22 + author);%0A        System.out.println(%22Price: %22 + price);%0A    %7D%0A%7D%0A%0Aclass Solution%0A%7B%0A%0A   public static void main(String %5B%5Dargs)%0A   %7B%0A      Scanner sc=new Scanner(System.in);%0A      String title=sc.nextLine();%0A      String author=sc.nextLine();%0A      int price=sc.nextInt();%0A      Book new_novel=new MyBook(title,author,price);%0A      new_novel.display();%0A%0A   %7D%0A%7D%0A

Add Java challenge