read_multiple_string

import java.util.*;
import java.io.*;
//javac read_multiple_str.java
public class read_multiple_str
{
//declaring variable
private int player_no;
public read_multiple_str(){ System.out.println("This is a constructor with no param");}
public static void main(String[] args) throws IOException
{
// creating instance and object "t" of the read_multiple_str class
Scanner sc = new Scanner(System.in);
System.out.println("Read three words " );
String n1 = sc.next();
String n2 = sc.next();
String n3 = sc.next();
read_multiple_str t = new read_multiple_str();
t.get_no(n1, n2, n3);

}
public void get_no(String n1, String n2, String n3)
{
System.out.println("received three words : "+ n1 + " " + n2 + " " +n3 );
}

}

although we may enter many words, the routine will read only three