Videos
Currently in my first programming course, and in the topic of objects and classes in Java, we've been given a task of creating a class that registers user's various inputs (Strings of texts, integers and decimals, e.t.c. Essentially creating a less generalized, more specified Scanner-class.), of which the instructions request the building of two constructors: one without parameters and one with so-called InputStream as its parameter; a term first introduced in this task, and which I assume through documentation is a specific class that is included in a java.io-package already included in most compilers and editors.
This definition comes in conflict, however, as while the official documentation seems to view InputStream as a class, the task I've been given describes it (In the context of this task of making a registering input-class.) of making InputStream as part of a constructor's parameter as a "...a data type to System.in.". This would make me presume that it is meant to be used in similar fashion of how we have learned of how basic parameters utilize primitive data-types (String, int, double, e.t.c.) along with its associated variable names, where such constructor for a class with the name "Register" would be in fashion of:
import java.util.Scanner;
public class Register {
private Scanner input = new Scanner(System.in);
//Constructor #1
public Register(){
}
//Constructor #2
public Register(InputStream System.in){
}This obviously doesn't work due to what I assume the function of InputStream acting as a class takes precedent than having it act as a data type (Can the name of classes even be designated as a data type? I haven't been able to find confirmation of it.). The term has been quite confusing along with the context of other input-related terminology of Scanner-class and System.in (The latter apparently is described as being an InputStream itself?), so I would much appreciate if someone could clarify what the task refers to when they claim that InputStream can act as a parameter of a constructor.