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
|
188 Discussions
|
Please Login in order to post a comment
Is anyone facing frivolous errors in OOPs questions of Java by the compiler??
for ex : you have written the entire correctly, yet you see an error - "expected { ..." . Also, there are pointless red underlines (errors) in your code, even when everything's alright ?
----->>>>> Java code
import java.util.*; abstract class Book{ String title; abstract void setTitle(String s); String getTitle(){ return title; }
}
class MyBook extends Book { void setTitle(String p) { title = p; } }
//Write MyBook class here
public class Main{
}
import java.util.*; abstract class Book{ String title; abstract void setTitle(String s); String getTitle(){ return title; } }
class MyBook extends Book{ String s1; void setTitle(String s){ this.s1 = s; String s1 = "A tale of two cities"; } String getTitle(){ return s1; } } //Write MyBook class here
public class Main{
}