Cloneable interfaces? (Choose two.)

Which two classes correctly implement both the java.lang.Runnable and the java.lang. Cloneable interfaces? (Choose two.)

Which two classes correctly implement both the java.lang.Runnable and the java.lang. Cloneable interfaces? (Choose two.)

A.
public class Session implements Runnable, Cloneable {
public void run();
public Object clone();
}

B.
public class Session
extends Runnable, Cloneable {
public void run() { /* do something */ }
public Object clone() { /* make a copy */ }
}

C.
public class Session
implements Runnable, Cloneable {
public void run() { /* do something */ }
public Object clone() { /* make a copy */ }
}

D.
public abstract class Session
implements Runnable, Cloneable {
public void run() { /* do something */ }
public Object clone() { /*make a copy */ }
}

E.
public class Session
implements Runnable, implements Cloneable {
public void run() { /* do something */ }
public Object clone() { /* make a copy */ }
}

Explanation:



Leave a Reply 1

Your email address will not be published. Required fields are marked *