Ask Question
2 April, 13:51

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. 2 April, 16:19
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers