Inheritance Gotchas
This lesson contains questions on inheritance in Java.
We'll cover the following...
Question # 1
Consider the setup below:
public class Language {
static String lang = "base language";
static protected void printLanguage() {
System.out.println(lang);
}
protected Language sayHello() {
System.out.println("----");
return this;
}
}
public class Spanish extends Language {
static String lang = "Spanish";
static protected void printLanguage() {
System.out.println(lang);
}
protected