You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
541 B
29 lines
541 B
6 years ago
|
/*
|
||
|
* Copyright (c) 2018-present, Facebook, Inc.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/
|
||
|
|
||
|
class Super {
|
||
|
public static void main(String args[]) {
|
||
|
// this loads SuperB and SuperA
|
||
|
System.out.println(SuperB.static_data);
|
||
|
|
||
|
// this loads SuperC and SuperD
|
||
|
SuperD.foo();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class SuperA {}
|
||
|
|
||
|
class SuperB extends SuperA {
|
||
|
static int static_data = 5;
|
||
|
}
|
||
|
|
||
|
class SuperC {}
|
||
|
|
||
|
class SuperD extends SuperC {
|
||
|
public static void foo() {}
|
||
|
}
|