Question 18
Consider the Java code given below that prints the recharge time of each charger in a list of chargers. From among the options, identify the appropriate function header for function display that takes as input a list of Charger objects and prints the recharge time of each.
import java.util.*;abstract class Charger{ abstract void rechargeTime();}class USBCharger extends Charger{ public void rechargeTime() { System.out.println("USB recharge time"); }}class LightiningCharger extends Charger{ public void rechargeTime() { System.out.println("Lightining charger recharge time"); }}public class Test { // LINE 1: FUNCTION HEADER { // invokes method rechargeTime() // to print the recharge time of each charger } public static void main(String[] args) { List<Charger> clist = new ArrayList<Charger>(); clist.add(new USBCharger()); clist.add(new LightiningCharger()); display(clist);
}}Choose the correct option(s).