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
|
204 Discussions
|
Please Login in order to post a comment
abstract class Book { String title;
}
class MyBook extends Book {
}
public class Solution { public static void main(String[] args) {
}
}
class MyBook extends Book{ @Override public void setTitle(String s){ this.title=s; } }
} `
import java.util.*; abstract class Book{ String title; abstract void setTitle(String s); String getTitle(){ return title; } }
//Write MyBook class here
// class Mybook, khong can public--Step1 class MyBook extends Book{ // dung tu khoa extend de ke tua lop abstract Book--Step2 @Override // ghi de method setTitle voi tham so, va tao body goi s --Step3 public void setTitle(String s){ this.title = s; }
}
public class Main{
}