import java.io.*; import java.util.*; public class Text{ public static void main(String argumendid[]) throws IOException{ BufferedReader in=new BufferedReader(new FileReader("a.txt")); String s=in.readLine(); String maxs=""; int max=0; while(s!=null){ StringTokenizer stk=new StringTokenizer(s, " "); while(stk.hasMoreTokens()){ String s2=stk.nextToken(); if(s2.length()>max){ max=s2.length(); maxs=s2; } } s=in.readLine(); } System.out.println("The longest word: "+maxs); } }