Last active
August 29, 2015 14:00
-
-
Save JorgeOlvera/11201237 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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