import java.util.Scanner; public class NameAndAddr1 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter first name and address: "); String firstName = input.next(); // Read 1st word as firstName String address = input.nextLine(); // Read rest of the line as addr System.out.println("firstName = " + firstName); System.out.println("address = " + address); } }