Which statement, when inserted into line "// TODO code application logic here ", is valid change?

Given:
public class SampleClass {
public static void main(String[] args) {
AnotherSampleClass asc = new AnotherSampleClass();
SampleClass sc = new SampleClass();
// TODO code application logic here
}
}
class AnotherSampleClass extends SampleClass {
}
Which statement, when inserted into line “// TODO code application logic here “, is valid change?

Given:
public class SampleClass {
public static void main(String[] args) {
AnotherSampleClass asc = new AnotherSampleClass();
SampleClass sc = new SampleClass();
// TODO code application logic here
}
}
class AnotherSampleClass extends SampleClass {
}
Which statement, when inserted into line “// TODO code application logic here “, is valid change?

A.
asc = sc;

B.
sc = asc;

C.
asc = (object) sc;

D.
asc = sc.clone ()

Explanation:
Works fine.



Leave a Reply 0

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