Skip to main content

Posts

Showing posts with the label Java Abstract Class Hackerrank Solution

Java Abstract Class Hackerrank Solution

 Java Abstract Class Hackerrank Solution For Explanation Watch Video: Sample Input A tale of two cities Sample Output The title is: A tale of two cities Code: import  java.util.*; abstract   class  Book{     String title;      abstract   void  setTitle(String s);     String getTitle(){          return  title;     }      } //Write MyBook class here class  MyBook  extends  Book{      void  setTitle(String s){         title = s;     } } public   class  Main{           public   static   void  main(String []args){          //Book new_novel=new Book(); Thi...