Hi Guys,
I m writing a
java program to get the sequence of number if the from no and to num is given
example
if i give from 1 to 10
the o/p is:
1
2
3
4
5
6
7
8
9
10
this works fine but whn i enter 0001 to 0010
the o/p is same as of the above.
bt i wan to display the value as follows:
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
The sample program as follows:
import java.io.*;
public class Generator{
public static void main(
String args[])
{
long arg1=Long.parseLong(args[0]);
long arg2=Long.parseLong(args[1]);
try {
BufferedWriter out = new BufferedWriter(new FileWriter("generate.csv"));
for(long i=arg1;i<=arg2;i++){
out.write("\""+i+"\"");
out.write("\r\n");
}
out.close();
} catch (IOException e) {
}
}
}
any suggestions?
Thanks in advance
Santhosh