Join Patrick Royal for an in-depth discussion in this video My solution: Working with files and images, part of Code Clinic: Java.
- The first thing you need to know…in order to complete this clinic…is how to work with files and images in Java.…Having an external file doesn't mean much…if you can't load it into Java in the form of an object…and then perform operations on it.…There are a number of different ways…to represent files through Java…depending on what you want to get out of the file.…If all you need is a reference to the file itself,…then the file class is sufficient.…If instead you need actual data from the file,…then you might choose to use a reader,…an image file or an input stream.…In this case, we only need the metadata,…so the standard file class is sufficient.…
To define a file, we need to provide…a pathway to that file.…In the main method, we do this with the pathway…src/codes/images.…Notice though, that this isn't actually…a reference to an image file.…This is a reference to the folder…which contains all of the image files.…Folders can be represented as files too in Java,…and they offer some specific methods…that can be used to interact with the files…
Patrick introduces challenges and provide an overview of his solutions in Java. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Visit other courses in the series to see how to solve the exact same challenges in languages like C#, C++, PHP, Python, and Ruby.
Skill Level Intermediate
Q: I am unable to access the Lake Pend Oreille data from outside the U.S.
A: A static copy of this data is provided here for lynda.com members outside of the U.S
Problem One: Exploring Lake Pend Oreille
Problem Two: Image Analysis
Problem Three: Eight Queens
Problem Four: Accessing Peripherals
Problem Five: Recursion and Directories
Problem Six: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.