75.6k views
5 votes
Given a String variable named line1 and given a Scanner reference variable stdin that has been assigned a reference to a Scanner object, read the next line from stdin and save it in line1. (Do not concern yourself with any possible exceptions here-- assume they are handled elsewhere.)

1 Answer

5 votes

Answer:

Scanner stdlin = new Scanner(System.in);

line1 = stdlin.readline();

Step-by-step explanation:

1.stdlin is the referenced input variable made by using built in Scanner class of Java language.

2.Than in line1 the next line from the console will be assigned by using readline function.

User Dan Borza
by
5.2k points