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.

Foo.java 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. public class Foo {
  2. private String _name;
  3. private static final int PRIVATECONST = 1;
  4. private static int privateClassVar = 2;
  5. private int privateInstanceVar = 3;
  6. protected static int protectedClassVar = 4;
  7. protected int protectedInstanceVar = 5;
  8. public static int publicClassVar = 6;
  9. public int publicInstanceVar = 7;
  10. public static int ClassVar = 8;
  11. public int InstanceVar = 9;
  12. public void foo() {
  13. // System.out.println("running " + this + ".foo()");
  14. }
  15. private static void privateClassMethod() {
  16. // System.out.println("in " + "Foo.privateClassMethod()");
  17. }
  18. private void privateInstanceMethod() {
  19. // System.out.println("in " + this + ".privateInstanceMethod()");
  20. }
  21. protected static void protectedClassMethod() {
  22. // System.out.println("in " + "Foo.protectedClassMethod()");
  23. }
  24. protected void protectedInstanceMethod() {
  25. // System.out.println("in " + this + ".protectedInstanceMethod()");
  26. }
  27. public static void publicClassMethod() {
  28. // System.out.println("in " + "Foo.publicClassMethod()");
  29. }
  30. public void publicInstanceMethod() {
  31. // System.out.println("in " + this + ".publicInstanceMethod()");
  32. }
  33. static void ClassMethod() {
  34. // System.out.println("in " + "Foo.ClassMethod()");
  35. }
  36. void InstanceMethod() {
  37. // System.out.println("in " + this + ".InstanceMethod()");
  38. }
  39. }