Been running yout reverse String program and I am trying to do a reverse on a Reverse.java file. Prints file forward but bit confused on how to reverse it. haven't found any samples out there
import java.io.BufferedReader; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.InputStreamReader; public class Reverse { public static void main(String[] args) { try{ // Open the file that is the first // command line parameter FileInputStream fstream = new FileInputStream("C:\\Users\\Phillip\\workspace\\Part-1 Lectures\\src\\Reverse.java"); // Get the object of DataInputStream DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; //Read File Line By Line while ((strLine = br.readLine()) != null) { // Print the content on the console System.out.println (strLine);