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.

ScopesAndFields_PR191.java 702B

123456789101112131415161718192021222324252627282930
  1. import org.aspectj.testing.Tester;
  2. public class ScopesAndFields_PR191 {
  3. public static void main(String[] args) {
  4. new ScopesAndFields_PR191().realMain(args);
  5. }
  6. public void realMain(String[] args) {
  7. C c = new C();
  8. c.a();
  9. Tester.checkEqual(c.c(), "C");
  10. Tester.checkEqual(c.c, "c");
  11. Tester.checkEqual(c.t(), "c");
  12. }
  13. }
  14. class C {
  15. public String c = "c";
  16. public String c() {
  17. Object c = "C";
  18. return c+"";
  19. }
  20. public String t() {
  21. Object c = "C";
  22. return this.c;
  23. }
  24. public void a() {
  25. String c = "C";
  26. Tester.checkEqual(c+"", "C");
  27. Tester.checkEqual(this.c, "c");
  28. }
  29. }