1 package test; 2 3 public class Foo { 4 Object fooObject; 6 8 public static void main(String [] args) throws Error { 9 System.out.println("Foo.main() " + (args.length > 1)); 10 Foo f = new Foo(); 11 f.foo(); 12 13 if (args.length > 0) { 14 FooBar fb = new FooBar(args.length > 1); 15 fb.foobar(); 16 } 17 18 try { 19 System.out.println("Calling Foo.toString()...."); 20 String s = f.toString(); 21 System.out.println(".... : " + s); 22 } 23 catch (Exception e) { 24 } 25 } 26 27 public Foo() { 28 System.out.println("Foo()"); 29 } 30 31 public void foo() { 32 System.out.println("Foo.foo()"); 33 } 34 } 35 | Popular Tags |