MODULE 2: I/O Operations Flashcards

1
Q

In Java, I/O is based on ______

A

Streams

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A _____ is a sequence of data elements that can be written sequentially

A

Stream

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Used for reading data from a source

A

InputStream

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Used for writing data to a destination

A

OutputStream

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Used to read characters from the keyboard or any other standard input device

A

System.in or Standard Input System

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Used to produce the result of a program on an output device

A

System.out or Standard output system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

This is the easiest of all methods as this is similar to printf in C. It can also take multiple arguments

A

printf()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

used to output all the error data that a program might throw

A

System.err or Standard error stream

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

They are commonly used for reading and writing text files

A

readers and writers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Streams are ______ while readers/writers are _______

A

byte-oriented, character-oriented

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The Java API which provides a number of classes that you will use to work with files

A

import.java.io*;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the three method of getting an input:

A
  1. BufferedReader Class
  2. Scanner Class
  3. JOptionPane Class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Designed to read input from a source (System.in) and it provides methods that you can use to retrieve the input formatted as primitive values or strings

A

Scanner Method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Retrieves the next line of the data and returns it as a string

A

nextLine();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Allows you to quickly display a dialog box

A

JOptionPane class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly