Skip to content

Instantly share code, notes, and snippets.

@JorgeOlvera
Last active August 29, 2015 14:00
Show Gist options
  • Save JorgeOlvera/11201237 to your computer and use it in GitHub Desktop.
Save JorgeOlvera/11201237 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class reverseWriter {
public static void main (String args[]){
String[] fileContents;
String[] reversedContents;
int count = 1;
try {
BufferedReader muchFile = new BufferedReader(
new FileReader(text.txt));
StringTokenizer suchToken = new StringTokenizer(text.txt);
while (suchToken.hasMoreTokens){
count += count;
}
fileContents = new String[count];
for (int i=0; i<count; i++){
fileContents[i] = suchToken.nextToken;
}
for (int j=0; j<count; j++){
reversedContents[j] = fileContents[count-j];
}
}
catch (FileNotFoundException e) {
System.err.println("There seems to be an error:\n" + e.getMessage());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment