Relative Content

Tag Archive for javaarrays

Read one text file and then arrange it and save it to another file

The task is to write a program that will fragment the lines of each file
back into its original format. In doing so, you need to find the parts that match each other as closely as possible. The end (or end of) a given part may match more than one part of the remaining parts, but only the two that match the most
characters. However, in order to avoid the task being too difficult, the first part of each line will always be on the first position on the line.

java method returns an array, issues assigning returned array to variable outside method

I am writing a java program that has a method that takes in an array, and an integer and uses a for loop to cycle through the array notes if the int is found at all, if it is a int is changed from 0 to 1, the loop continues as there can be duplicate++ entries for this program so a counter is incremented for each time the int is found, and the index of the first array slot it was found is also noted (another function run previous to this sorts the array, so no matter how many duplicates there are, they should all be together.