Objective Today, we're taking what we learned
yesterday about Inheritance
and extending it to Abstract
Classes. Because this is a very specific Object-Oriented
concept, submissions are limited to the few languages that use this
construct. Check out the Tutorial
tab for learning materials and an instructional video!
// Declare your class here. Do not use the 'public' access modifier. // Declare the price instance variable /** * Class Constructor * * @param title The book's title. * @param author The book's author. * @param price The book's price. **/ // Write your constructor here /** * Method Name: display * * Print the title, author, and price in the specified format. **/ // Write your method here // End class
public class Solution { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String title = scanner.nextLine(); String author = scanner.nextLine(); int price = scanner.nextInt(); scanner.close();
Book book = new MyBook(title, author, price); book.display(); } }