From the course: Nail Your Java Interview

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Mastering polymorphism with a deeper look at Java

Mastering polymorphism with a deeper look at Java - Java Tutorial

From the course: Nail Your Java Interview

Start my 1-month free trial

Mastering polymorphism with a deeper look at Java

- [Tutor] In this lesson, we'll take a deeper look at the functionality, built into Java to see how it's benefiting from using polymorphism. We'll start with the example from the previous lesson with our non-negative array list. This class took on the form of an array list as well as the form of a non-negative array list, depending on what functionality was called. There are actually even more forms that a non-negative ArrayList class can take. Let's look at the ArrayList class. Here, we see the ArrayList class extends abstract list and implements a few interfaces. The E and the arrow brackets has to do with the topic called generics. We won't dive into generics here but it's what allows you to create array list with integer string or any data you like. The data type inside the array list doesn't matter, but it does have to be of a single type. Abstract list is an abstract class that would be interesting to look at later…

Contents