import java.io .* ; import java.util.*; public class Tex{ String fail ; private Tex(String fail){this.fail=fail ; this.doItBaby(); } void doItBaby(){ try{ BufferedReader in=new BufferedReader(new FileReader(new File(fail))) ; String content=this.read(in) ; StringTokenizer st=new StringTokenizer(content); int how_many=st.countTokens(); System.out.println("Sonu oli "+how_many) ; }catch (FileNotFoundException e){ System.out.println("File Not Found !") ; } catch(Exception e){} } String read(BufferedReader buffu) throws Exception { String out=""; String current="" ; while((current=buffu.readLine())!=null){ out+=current+" " ; } return out ; } public static void main (String args[]){ if(args.length!=1){System.out.println("Command line parameter error !"); System.exit(0) ; } new Tex(args[0]) ; } }