public static void main(String[] args) {
   Cleanser x = new Cleanser();
   x.dilute();
   x.apply();
   x.scrub();
   System.out.println(x);
   monitor.expect(new String[] {"Cleanser dilute() apply() scrub()"});
 }
 public static void main(String[] args) {
   Bart b = new Bart();
   b.doh(1);
   b.doh('x');
   b.doh(1.0f);
   b.doh(new Milhouse());
   monitor.expect(new String[] {"doh(float)", "doh(char)", "doh(float)", "doh(Milhouse)"});
 }
 public static void main(String[] args) {
   Snake s = new Snake(5, 'a');
   System.out.println("s = " + s);
   Snake s2 = (Snake) s.clone();
   System.out.println("s2 = " + s2);
   s.increment();
   System.out.println("after s.increment, s2 = " + s2);
   monitor.expect(
       new String[] {"s = :a:b:c:d:e", "s2 = :a:b:c:d:e", "after s.increment, s2 = :a:c:d:e:f"});
 }
 public static void main(String[] args) {
   int i = -1;
   System.out.println(i >>>= 10);
   long l = -1;
   System.out.println(l >>>= 10);
   short s = -1;
   System.out.println(s >>>= 10);
   byte b = -1;
   System.out.println(b >>>= 10);
   b = -1;
   System.out.println(b >>> 10);
   monitor.expect(new String[] {"4194303", "18014398509481983", "-1", "-1", "4194303"});
 }
예제 #5
0
 public static void main(String[] args) {
   PrintWriter out = new PrintWriter(System.out, true);
   out.println("Hello, world");
   monitor.expect(new String[] {"Hello, world"});
 }
 public static void main(String[] args) {
   PrivateOverride po = new Derived();
   po.f();
   monitor.expect(new String[] {"private f()"});
 }
 public static void main(String[] args) {
   Integer n1 = new Integer(47);
   Integer n2 = new Integer(47);
   System.out.println(n1.equals(n2));
   monitor.expect(new String[] {"true"});
 }