Java Program to find the number of the words in the given text fileIn this program, we need to find the most repeated word present in given text file. This can be done by opening a file in read mode using file pointer. Read the file line by line. Split a line at a time and store in an array. Iterate through the array and count the word. The content of data.txt file used in the program is shown below. data.txt A computer program is a collection of instructions that performs specific task when executed by a computer. Computer requires programs to function. Computer program is usually written by a computer programmer in programming language. A collection of computer programs, libraries, and related data are referred to as software. Computer programs may be categorized along functional lines, such as application software and system software. Algorithm
Program:Output: Number of words present in given file: 63 Next TopicJava Programs |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India