O'Reilly logo

Java 9 Concurrency Cookbook - Second Edition by Javier Fernández González

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

Perform the following steps to implement the example:

  1. Create a class named FileSearch and specify that it implements the Runnable interface. This class implements the file search operation:
        public class FileSearch implements Runnable { 
  1. Declare two private String attributes: one named initPath, which will store the initial folder for the search operation, and the other named end, which will store the extension of the files this task is going to look for:
        private String initPath;         private String end; 
  1. Declare a private List<String> attribute named results that will store the full paths of the files that this task has found:
        private List<String> results; 
  1. Implement the constructor of the class that will initialize ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required