Description:
In this course, participants learn more about Java's application programming interface (API) for working with files and directories. You will begin with the Path interface and the Paths.get methods to work with files and directories, which form the foundation of the modern java.nio APIs. You will then discover how to use the methods of the Path interface to normalize, parse, and resolve paths. Next, you will briefly detour into creating files using both the legacy java.io as well as the modern java.nio namespaces. Perform operations such as copying files, checking for their existence, and deleting files using the Files class in the java.nio namespace. Participants will also copy and create directories by using the Files class in the java.nio namespace. You will explore how to get and set file attributes (including both platform-agnostic as well as Portable Operating System Interface attributes), and query file stores for total and free space. Finally, learn how to create directories and iterate over their contents, including via the use of glob specifiers to filter directory contents.
Target Audience:
Duration: 01:01
Description:
In this nine-video course, you will be focusing on Java's parallel class hierarchies for working with byte and character data and the various variants available to you. To begin, participants will learn how buffered stream handling saves on unnecessary inout-output (IO). Learn how to use the BufferedInputStream and BufferedOuputStream classes to interact efficiently with byte streams, and then to use the BufferedReader and BufferedWriter classes to interact efficiently with character streams. As you progress, you will explore how to use the DataOutputStream class to write primitive types and strings to byte strings, and the DataInputStream class to read primitive types and strings from byte streams. This leads participants to utilize the ObjectOutputStream class to write objects of any type to byte streams and the ObjectInputStream class to read objects of any type from byte streams. Finally, you will implement the Serializable interface in user-defined classes so that they can be written to and read from using ObjectOutputStream and ObjectInputStream objects.
Target Audience:
Duration: 01:11
Description:
In this series of video tutorials, you will learn about file and stream handling in Java with a strong conceptual foundation, before moving onto practical scenarios. Begin by learning how to navigate Java's complicated hierarchy of classes for dealing with byte and character streams. You will then learn how to apply the skip and available methods of FileInputStream objects and identify when the end of a byte stream has been reached. You will be able to write a byte stream by using the OutputStream and FileOutputStream classes, and then examine how to copy any file as a byte sequence using the FileInputStream and FileOutputSream classes. Move on to learning how to read a character stream using the FileReader and FileWriter classes. You will then copy a character file as a sequence of characters using the FileReader and FileWriter classes. At the end of the course, participants will be able to summarize the key concepts covered.
Target Audience:
Duration: 00:54
Description:
In this course, you will learn about the correct use of the throws clause, Java's relatively new try-with-resources construct, and the use of custom exceptions. Explore how to correctly use the throws clause while defining method signatures and implementing exception handling in a chain of methods that sequentially call each other. You will learn to ensure that resources are automatically closed, relying on language support, using the try-with-resources construct; and recognize the precise semantics of this construct in Java. This leads to throwing an object of a built-in exception type to respond to an unexpected situation in a program, and differentiating between the semantics of throwing runtime exceptions versus checked exceptions. The correct way to invoke a method that throws an exception of a checked exception type will be examined, along with how to correctly declare or handle exceptions in a chain of functions, each of which throws different types of exceptions. Finally, participants will explore the use of custom exceptions, defining their own exception classes, and then throwing exceptions that belong to those classes.
Target Audience:
Duration: 01:28
Description:
This course covers the bedrock of Exception Handling in Java, the try-catch-finally code structure. Participants will cover the class hierarchies in exception handling; the stream and file processing; and how Java's support for exceptions and streams is built around complex class structures. You will learn how code might result in exceptions that are enclosed within a try block. Because this code structure could result in a signal to Java that normal programming might be disrupted and will cause the code evaluation to be short-circuited, the course explores details of catch blocks, including the use of multiple catch blocks; the use of the pipe operator (operator) to chain different exceptions within the same catch block; and how catch blocks must be arranged for related exceptions. The last part of exception handling is the 'finally block.' This keyword (finally) is used to ensure the correct release of resources, such as file handles, no matter what handled or unhandled exceptions might arise within the try block.
|Target Audience:
Duration: 01:18
Description:
This course explores Exception Handling in Java and provides users with a strong conceptual and theoretical foundation and examines practical code-based scenarios. Begin by examining what exceptions are in Java and how Java’s class hierarchy addresses errors, runtime exceptions, and checked exceptions. An exception is an event that disrupts the normal flow when executing a program, and you will learn here how to differentiate between exceptions and errors. Participants will learn to use Java's catch-or-specify requirement on code that throws specific types of exceptions. You will also learn that an exception handler is code which deals with a particular exception, both its type and location, in the program. Next, learn the sequence of method calls or function calls which culminated in the exception being thrown. The course will then explore the common runtime exceptions, and see how input-output (IO)-related code often poses special challenges in exception handling. Finally, you will be shown how exception handling is tied to the try-catch keywords.
Target Audience:
Duration: 00:55
Description:
This course examines Java's support for exceptions and covers three specific topics: initialized blocks, the details of pass-by-value and pass-by-reference semantics, and the two types of nested classes. You will work in Java with initialization blocks on both static member values to construct static elements in your class and on non-static member variables as an alternative to constructors. This course uses examples of pass-by-value and pass-by-reference code to demonstrate how variables behave when they are passed from one function to another in arrays and strings. Next, learners explore the semantics of argument passing for primitive types, strings, and for objects. You will experiment with arrays and learn to use the Arrays.toString helper method. You will learn the rules and conventions that govern the two types of nested classes: static classes and inner classes. Finally, learn how a static class is created or nested inside a class, and how inner classes can logically group classes and interfaces in one place.
Target Audience:
Duration: 01:24
Description:
This course explores member functions and their invocation in Java. learners begin by studying object references and learning the subtleties and nuances of how these references sometimes lead to unexpected results in a program. Learn to use a copy constructor to break references that existed from rectangle objects to the point objects and how they become self-sufficient. Next, you will see that the classes you created often have multiple overloaded methods, which can lead to code duplication. You will learn how to correctly chain the implementations of overloaded constructors and other overload methods. You will also begin to understand the reference variable, 'this' keyword, to avoid naming conflicts in constructor chaining. You will see how to create variables or methods that ought to be one per class, rather than one per instance using the static keyword. Finally, you will become familiar with the different rules that govern how static members and methods are accessed, and how some forms of access that are allowed by the Java compiler are not considered a best practice.
Target Audience:
Duration: 01:03
Description:
The instantiation of objects in Java is the subject of this 9-video course, in which learners explore how each class has one or more constructor methods. This course examines the default, no-argument constructor provided by Java for each class and shows how constructors initialize member variables to a sensible initial state. Each learner will create his or her own defined class, instantiate that class, and use different types of constructors. You will learn to define your own parameterized constructor and will see that Java automatically removes the default no-argument constructor. Then explore how to implement correct getter and setter methods and to use the getter and setter methods to access member variables from outside a class, along with the use of the private access modifier to regulate such access. This course shows different overloaded methods in the context of constructors. Finally, you will learn that Java allows overloading constructors in a class, and how this ability allows one to create objects by using different methods.
Target Audience:
Duration: 01:00
Description:
What makes the programming language Java so useful is that can run on multiple platforms. In this course, you will examine Java and its support for object-oriented programming. This course uses real-world entities to demonstrate how member variables represent the state of those entities, and how member functions represent the behavior of those entities. Participants study the various basic types of variables in Java and distinctions between eight primitive types and strings, which are a type of object. You will learn that all basic building blocks of all operations are these basic types of variables. As a practical exercise, create a project in Java with Java's two basic building blocks, the twin concepts of classes and objects. Next, learn to create classes and instantiate objects of these classes. You will discover that all objects in Java come with certain built-in capabilities, because they all inherit from a common ancestor base class. Finally, participants learn how to use constructors, getter methods, and setter methods to configure and initialize Java objects.
Target Audience:
Duration: 01:03