• + 0 comments

    abstract class Book { String title;

    // Implement the body in the child class
    abstract void setTitle(String s);
    
    String getTitle() {
        return title;
    }
    

    }

    class MyBook extends Book {

    void setTitle(String s) {
     super.title = s;
    }
    

    }

    public class Solution { public static void main(String[] args) {

        Book bookTitle = new MyBook();
        Scanner scan = new Scanner(System.in);
    
        String title = scan.nextLine();
    
        bookTitle.setTitle(title);
    
        System.out.println("The title is: " + 
        bookTitle.getTitle());
    
            }
    

    }

    }
    

    }