Input and Output: Lesson
Lesson 1 of 1
  1. 1
    As computer users we are familiar with the response computer programs have from user input and output. This lesson helps show the flip side of how programmers can code a Java program that considers…
  2. 2
    Let’s start by breaking down what each element of the statements System.out.print(), System.out.println(), and System.out.printf()represent. - System is a class that has already been built into Ja…
  3. 3
    Just like System, the Scanner class is predefined and built into Java for your use. It’s used to read user input in a Java program. For this exercise, we will build a program that walks us through…
  4. 4
    FileOutputStream and FileInputStream are two of Java’s built-in classes and can be extremely useful when your program is working with external files. FileInputStream is used to read data from a fil…
  5. 5
    Now, let’s take a closer look at FileOutputStream. FileOutputStream is used to output data from a program into a file. Like FileInputStream, FileOutputStream writes in bytes and then converts to th…
  6. 6
    Errors are unwanted issues that occur in a program that cannot be handled by a program. They may even result in a program crashing. Exceptions are issues that may occur when a program is runnin…
  7. 7
    You’ve made it to the end! Let’s review what we have learned so far: - Printing output in a Java program can be done using the following three commands: System.out.print();, System.out.println(), …

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo