Write a statement that reads a word from standard input into firstWord. Assume that firstWord. has already been declared as a String variable. Assume also that stdin is a variable that references a Scanner object associated with standard input.

Respuesta :

// taking the super class object to take input

Scanner stdlin = new Scanner(System.in);

// saving it in the firstWord

// assuming that the firstWord is already declared as mentioned in question

firstWord = stdlin.nextString();

//Java uses nextstring method of class scanner to take a word as input.