Q.– Given this segment of code:-
ArrayList<cycle> myList = new ArrayList<>();
myList.add(new Motorcycle( ));
Which two statements, if either were true, would make the code compile?
A) cycle and Motorcycle both extend the Transportation super-class.
B) cycle is an interface that is implemented by the Motorcycle class.
C) cycle and Motorcycle both implement the Transportation Interface.
D) Motorcycle is a super-class of cycle.
E) Motorcycle is an interface that implements the Cycle class.
F) cycle is an abstract super-class of Motorcycle.
⧪ please give your answer in a comment section.
ArrayList<cycle> myList = new ArrayList<>();
myList.add(new Motorcycle( ));
Which two statements, if either were true, would make the code compile?
A) cycle and Motorcycle both extend the Transportation super-class.
B) cycle is an interface that is implemented by the Motorcycle class.
C) cycle and Motorcycle both implement the Transportation Interface.
D) Motorcycle is a super-class of cycle.
E) Motorcycle is an interface that implements the Cycle class.
F) cycle is an abstract super-class of Motorcycle.
⧪ please give your answer in a comment section.
11 Comments
Answer is A D
ReplyDeleteA C
ReplyDeleteA C
ReplyDeleteAd
ReplyDeleteA C
ReplyDeleteAC
ReplyDeleteAC
ReplyDeleteA C
ReplyDeleteC F
ReplyDeleteBF
ReplyDeleteB and F
ReplyDelete