note 86661 deleted from language.oop5.paamayim-nekudotayim by danbrown
| From: | danbrown@php.net | Date: | Tue, 28 Oct 2008 21:19:48 +0000 |
| Subject: | note 86661 deleted from language.oop5.paamayim-nekudotayim by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-145909@lists.php.net to get a copy of this message | ||
Note Submitter: Paul Nahay (pnahay at sprynet dot com)
Reason: bad code
----
Actually, Java behaves exactly the same way; remember, we're dealing with static methods here,
not instance methods:
class ExampleSuperclass {
static String classType() {
return "superclass";
}
static void doSomething() {
System.out.println("doing something with " + classType());
}
}
class ExampleClass extends ExampleSuperclass {
static String classType() {
return "subclass";
}
}
public class JavaTest {
public static void main(String[] args) {
ExampleClass.doSomething();// doing something with superclass
}
}