Reading a file and change the content with vector

Example

import java.io.*;
import java.util.*;// Arrays.sort
public class Test_This {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
//C:/myjava/eclipse_classic/eclipse/ch2/test/index.html
Process p1 = new Process();
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String file_name ="";
Process pp = new Process();
try{
System.out.print("Please Enter a File name: ");
file_name = br.readLine();
pp.method_1(file_name);
}//try
catch(NumberFormatException e)
{ System.out.println("data was blank");}

}
}
class Process
{
//vector is stretchable
public Process(){System.out.println("Default) constructor");}
public void method_1(String str)throws IOException
{
String file_name="", line;
//ArrayList buff = new ArrayList();
Vector buff = new Vector();
int index = 0, index2=0;
BufferedReader Source = new BufferedReader( new FileReader( str));
try {
//for (int i =0; i <buff.length; i++)
while ((line = Source.readLine()) != null)
{
buff.add(line);
}
} catch (IOException e) { System.out.println("could not read at process"); }
finally{ Source.close(); System.out.println("Soruce closed"); }
Iterator it = buff.iterator();
System.out.println("---Iteratring Array List----");

while(it.hasNext())
{
System.out.println(index++ + "\t" + it.next());

}
System.out.println("--replaced a line with---");
buff.set(8, " Welcome to Java Vector");
Iterator it_2 = buff.iterator();
while(it_2.hasNext())
{
System.out.println(index2++ + "\t" + it_2.next());

}
}
}

Since Vector or ArrayList create an Internal Index that can be used to edited with vector.set

Note the line was replaced with welcome to java.