Learn to create and use enumerations in Java.
- [Voiceover] In this video I'll explain…how to write an enumeration…and how to use an enumeration…within a list and within a map.…An enumeration is a data structure…with a finite number of fields.…To create an enumeration you use the keyword "enum",…E-N-U-M, and give the class a name,…in this case, DaysEnum.…If you're going to be using enumerations…in database systems or file storage systems,…I strongly suggest that you include "UNKNOWN"…within your enumeration.…
Under the covers, Java will substitute the integer zero…for the word "UNKNOWN".…Note that each of the values within an enumeration…is separated by a comma.…There's no trailing comma after the last word.…The second class that we'll examine is called EventHolder.…It's a simple class.…It has a DaysEnum and it has a String.…We can expand the class by pressing control shift plus,…and the plus is on the plus side from your numeric keypad.…
You'll see we have a simple no-argument constructor…and getters and setters for each of our fields.…The second constructor contains…
- The IMQAV model
- Downloading software
- Installing and setting up a Java coding environment
- Mock tests
- Code coverage
- Using windows, views, and modes in IntelliJ IDEA
- Creating classes and attributes
- Creating constructors
- Casting variables
- Matching literals with regular expressions
- Regular expressions
- Design patterns
Skill Level Intermediate
Java: Database Integration with JDBCwith David Gassner2h 51m Intermediate
NumPy Data Science Essential Trainingwith Charles Kelly3h 54m Intermediate
1. Getting Started with Java
2. Test-Driven Development
3. IntelliJ IDEA
4. Object-Oriented Java
6. Regular Expressions (Regex)
8. Design Patterns
9. Applying Data Science
- 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.