Hello,
I have an example with me, see if this helps you.
Code:
Public Interface wkr {
+ Set / get
}
Public Interface emp {
+ Set / get
}
Public class Person implements wkr, emp {
- Attributes of'forums
+ Set / get
public emp evl () (
if (this instanceof emp) (
throw new evlImpossibleException ();
)
emp emp = new Person ();
employe.setX (this.getX ());
....
return emp;
)
Public wkrs regression () (
if (this instanceof wkr) (
throw new RegressionImpossibleException ();
)
wkr w= new Person ();
ouvrier.setX (this.getX ());
....
return workers;
)
)
public class Test (
public void test () (
wkr w= new Person ();
emp emp = new Person ();
...
emp e = ouvrier.evolution ();
....
)
)
Bookmarks