We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
`Optimal solution for this problem | Easy to Understand
abstractclassBook{abstractvoidsetBooktitle(Strings);}classMyBookextendsBook{@OverridevoidsetBooktitle(Strings){System.out.println("The title is: "+s);}}publicclassSolution{publicstaticvoidmain(String[]args){/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */Scannersc=newScanner(System.in);Stringstr=sc.nextLine();MyBookbook=newMyBook();book.setBooktitle(str);
sc.close();
}
}
`
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Abstract Class
You are viewing a single comment's thread. Return to all comments →
} `