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.
Java Abstract Class
Java Abstract Class
Sort by
recency
|
209 Discussions
|
Please Login in order to post a comment
Java abstract classes are powerful tools to design flexible and reusable code. They allow developers to define a blueprint for related classes, enforcing specific behaviors (via abstract methods) while sharing common functionality (via concrete methods). Cricbet99 Green
Here is Java Abstract Class solution - https://programmingoneonone.com/hackerrank-java-abstract-class-problem-solution.html
import java.util.*; abstract class Book{ String title; abstract void setTitle(String s); String getTitle(){ return title; }
} final class MyBook extends Book{ void setTitle(String title2){ this.title = title2; } } public class Main{
}
Tried this useless platform after a while and remembered why I left. Retards here never realized one is not supposed to put solution in discussion.
public class Solution {
}
abstract class Book{ String title; abstract void setTitle(String s); String getTitle(){ return title; } }
class MyBook extends Book{ @Override void setTitle(String s){ super.title = s; } }