Skip to content
Snippets Groups Projects
Commit 2626351b authored by Thomas's avatar Thomas
Browse files

added test and example code

parent 37cc6846
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>test</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
package core;
public class Person {
public final int id;
protected String name;
public Person(int i,String n) {name=n; id=i;}//shadows i(11)
public int getId() {return id;}
public String getName() {return name;}
public void setName(String name) {this.name = name;} //shadows name(5)
int i;
public void work() {
for (i = 0; id < 10; i++) {/* ... */}
for (int i = 0; i < 10; i++) {/* ... */}//shadows i(14)
}
}
package ext;
import core.Person;
public class Employee extends Person {
private int id; //shadows Person::id(4)
public Employee(int i,String n) {super(i,n);id=i;}
public int getId() {return id+1000;}
public String getName() {return "E "+name;}
private class Memo {
private Memo(int i,String n){id=i;name=n;}
private final int id;//shadows id(6)
private final String name;//shadows Person::name(5)
}
public Memo save() {return new Memo(id,name);}
public void restore(Memo m) {id=m.id; name=m.name;}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment