I have fixed some parameters to my constructor but unable to make them work.
Here is my sample code:-
Expand|Select|Wrap|Line Numbers
- public MyConstructor(String filename, int value1, int value2){
- this.filename = filename;
- this.value1 = value1;
- this.value2 = value2;
- File reading code
- BufferedReader fh = new BufferedReader(new FileReader(filename));
- ................
- }
- public static void main(String args[]) {
- String s1 = args[1];
- String s2 = args[2];
- int value1 = Integer.parseInt(s1.trim());
- int value2 = Integer.parseInt(s2.trim());
- MyConstructor myobject = new MyConstructor(args[0], value1, value2);
- }
Thanks