Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Java Data Structures!
You have completed Java Data Structures!
Preview
Interfaces help define a contract that a class must adhere to. Let's learn how to sign those contracts.
Copy/Paste
Movie movie1 = new Movie("Spirit: Stallion of the Cimarron", "Family", LocalDate.of(2002, 5, 24));
Movie movie2 = new Movie("Life is Beautiful", "Comedy", LocalDate.of(1997, 12, 20));
Movie movie3 = new Movie("My Neighbor Totoro", "Fantasy", LocalDate.of(1988, 4, 16));
Resources
- Interfaces
- Implementing an interface
- java.lang.Comparable
- Access Control keywords - (Class code can see inside other instances of the same class because it is private to the class)
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
I'm going to move pretty quick,
but it's all things
0:00
we've covered in the prerequisites.
0:02
All right, let's go.
0:03
I'm going to add two new movies here.
0:05
The text for these
will be down in the teacher's notes,
0:07
so you won't need to type all this out
either.
0:09
So movie two is a recommendation
that Brian gave me.
0:12
Thank you, Brian.
0:15
And movie three was from Christian,
so thank you as well, Christian.
0:16
Now, don't judge me, everyone.
0:20
Can you believe I've never seen this one?
0:21
It came out 12 days after I was born, too.
0:23
I'm such a slacker.
0:26
While we're at it, let's
clean up a bit and move this local date.of
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up