Ask Question
20 June, 12:59

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.)

+5
Answers (1)
  1. 20 June, 13:52
    0
    Scanner stdlin = new Scanner (System. in);

    line1 = stdlin. readline ();

    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.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Given a String variable named line1 and given a Scanner reference variable stdin that has been assigned a reference to a Scanner object, ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers