• Post Reply Bookmark Topic Watch Topic
  • New Topic

An Interview Questions: Reading data file  RSS feed

 
Priyakant Charokar
Ranch Hand
Posts: 58
Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a big text file (very big. .. ). It should print me no of alphabets ... like a=25000, b=5766000 .... and so on.

What would be the best ways to and print...
 
Priyakant Charokar
Ranch Hand
Posts: 58
Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a big text file (very big. .. ). Program should print me number of alphabets ... like a=25000, b=5766000 .... and so on.

What would be the best ways to read and print...
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What ideas have you had? Are you familiar with the classes in the java.io package, like FileInputStream, InputStreamReader and BufferedReader? Together, these could be used to solve the I/O part of the problem.

Other that that, I'd envision your code to have a data structure like Map<Character, Integer> letterCount .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!