fork download
  1. public class A {
  2. public static Integer d = 3;
  3. }
  4.  
  5. public class B extends A {
  6. public static void fun() {
  7. System.debug(A.d);
  8. A.d = 5;
  9. }
  10. }
  11.  
  12. public class C extends A {
  13. public static void fun2() {
  14. System.debug(A.d);
  15. }
  16. }
  17.  
  18. public class MainClass {
  19. public static void main(String[] args) {
  20. B.fun();
  21. C.fun2();
  22. }
  23. }
  24.  
Success #stdin #stdout #stderr 0.01s 8904KB
stdin
Standard input is empty
stdout
Object: UndefinedObject error: did not understand #A
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject class(Object)>>doesNotUnderstand: #A (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
stderr
./prog:3: parse error, expected identifier or binary operator or keyword