Ask Question

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

+3
Answers (1)
  1. 25 August, 21:11
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers