File: X.java

package info (click to toggle)
eclipse-jdt-ui 4.29-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 93,280 kB
  • sloc: java: 831,977; xml: 14,578; jsp: 33; makefile: 5
file content (34 lines) | stat: -rw-r--r-- 507 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package p;

class X {
	String value;
	X field = this;

	public X(String value) {
		this.value = value;
	}

	public String m1() {
		return value;
	}

	public String m2() {
		return value;
	}

	public X(X otherX) {
		this.value = "created in X::new";
	}

	public X instanceMethod() {
		return new X("created in X::instanceMethod");
	}

	public X instanceMethod2(X x) {
		return new X("created in X::instanceMethod2");
	}

	public static X staticMethod(X x) {
		return new X("created in X::staticMethod");
	}
}