0 votes
in JAVA by
How to take multiple string input in java using a scanner?

1 Answer

0 votes
by

How to take multiple string input in java using a scanner?

class MyClass {

    public static void main(String[ ] args) {

        Scanner a = new Scanner(System.in);

        //Scanner b = new Scanner(System.in);       

        System.out.println (a.nextLine());

        System.out.println(a.nextLine());

    }

}

Then type this way:

a

b

🔗Reference : stackoverflow.com

🔗Source: Java Interview Questions and Answers

🔗Reference: Javatpoint.com

Related questions

+1 vote
asked May 6, 2021 in JAVA by SakshiSharma
0 votes
asked Mar 16, 2021 in JAVA by Robindeniel
...