import java.util.ArrayList; import java.util.List; interface chewable {} class Gum implements chewable {} class Meat implements chewable {} public class Tester { public static void main(String[] args) { List list1 = new ArrayList<chewable>();// line 1 list1.add(new Gum());// line 2 list1.add(new Meat());// line 3 list1.add(new Integer(9));// line 4 System.out.println(list1.size());// line 5 } }
import java.util.List;
interface chewable {}
class Gum implements chewable {}
class Meat implements chewable {}
public class Tester {
public static void main(String[] args) {
List list1 = new ArrayList<chewable>();// line 1
list1.add(new Gum());// line 2
list1.add(new Meat());// line 3
list1.add(new Integer(9));// line 4
System.out.println(list1.size());// line 5
}
Oracle Certified Professional Java Programmer
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.