In Java, you create a subclass of an existing class with the keyword "extends". Each class can have one and only one superclass. If you don’t define an explicit superclass, then your custom class extends the Java Object class.
- [Narrator] In Java, you create a subclass…of an existing class with the key word extends.…Each class in Java can have one and only one super class.…If you don't define an explicit super class…then your custom class extends the Java object class.…I'm going to start by creating a new custom class.…It's going to hold some data.…And in Java, there's a convention that says,…this kind of class is sometimes known as a model class.…I'll organize my code by putting these kinds of classes…in their own package.…
From the base package of the application,…I'll create a new package, and I'll name it model.…And then I'll create a new Java class…that's in that package.…And I'll name it ClothingItem.…This is going to become a super class.…I'm creating an inheritance hierarchy,…where I have a clothing item class,…and then it can have one or more sub-classes…for each type of clothing I want to sell.…All clothing items have a certain amount…of common functionality.…Each item has a particular type,…each item has a size, and each has a price.…
- Debugging Java code
- Handling exceptions
- Creating custom classes
- Working with inheritance
- Managing data collections
- Using Java packages and libraries
- Preparing a Java application for deployment
Skill Level Intermediate
1. Exception Handling and Debugging
2. Create Custom Classes
3. Work with Inheritance
4. Manage Data Collections
5. Use Java Packages and Libraries
Work with dates and times7m 12s
6. Prepare a Java Application for Deployment
Next steps1m 12s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.