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