Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
// Superclass
class Base {
// Subclassta saklanacak static metod.
public static void display() {
System.out.println("Static or class method from Base");
}
// Subclassta override edilecek non-static metod.
public void print() {
System.out.println("Non-static or Instance method from Base");
}
}
// Subclass
class Derived extends Base {
// Static burada kaldırıldı. (Compiler Error)
public void display() {
System.out.println("Non-static method from Derived");
}
// Static burada eklendi ( Compiler Error)
public static void print() {
System.out.println("Static method from Derived");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment