KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tctest > transparency > SubClassB


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tctest.transparency;
5
6 public class SubClassB extends SuperClassWithFields implements Cloneable JavaDoc {
7
8   public synchronized void method1() {
9     i = 10;
10     super.method1();
11   }
12
13   public SubClassB getCopy() {
14     try {
15       return (SubClassB) super.clone();
16     } catch (CloneNotSupportedException JavaDoc e) {
17       throw new RuntimeException JavaDoc(e);
18     }
19   }
20   
21   public String JavaDoc toString() {
22     return "SubClassB::" + super.toString();
23   }
24   
25   public boolean equals(Object JavaDoc o) {
26     if (this == o) return true;
27     if (o instanceof SubClassB) { return super.equals(o); }
28     return false;
29   }
30 }
31
Popular Tags