Join Ketkee Aryamane for an in-depth discussion in this video Using the Runnable interface to create and run a thread, part of Java EE: Concurrency and Multithreading.
- [Instructor] So we have seen how to create a thread…using the thread class in your Java application.…Now let's understand how to create a thread…using the Runnable interface.…Runnable interface, like the thread class,…is present under the java.lang package.…And like the thread class again, Runnable interface…has also got the run method declared, which is going…to specify the job of the thread to be spawned, right?…Now, whenever you want to create threads in your system,…this runnable interface option is always preferred.…That's because in Java we all know that we can have a class…that implements multiple interfaces but you cannot…have a class that extends more than one class, right?…So if you try to extend the thread class you wouldn't…be able to extend any other class.…
So we generally go with the option…of the runnable interface to create threads…in our multi-threaded Java applications.…So let's go ahead and do a demo for this.…The use case is the same.…We are still going to have the thread doing the job…
- What is concurrency?
- Processes and threads in Java SE
- Java EE concurrency APIs
- Working with the ManagedExecutorService, ManagedScheduledExecutorService, ManagedThreadFactory, and ContextService APIs
- Defining data access object (DAO) classes
- Adding methods to DAO classes
- Writing REST classes
- Creating custom thread factories
- Creating contextual proxies
- JTA transactions and concurrency
Skill Level Intermediate
Java EE: Contexts and Dependency Injectionwith Alex Theedom1h 43m Intermediate
Java EE: Design Patterns and Architecturewith Alex Theedom2h 44m Intermediate
Java EE: Servlets and JavaServer Pages (JSP)with Ketkee Aryamane6h 14m Intermediate
1. Overview and Setup
2. Processes and Threads
3. Executor API
4. Java EE Concurrency APIs
5. Concurrency and Transactions
- 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.