extending abstract class
- From: Carramba <nospam@xxxxxxxx>
- Date: Sat, 28 Jan 2006 11:21:22 +0100
hi!
I want to make abstract class for reading file import java.io.*; import java.util.*;
public abstract class fileCommand {protected String fileName;
public ArrayList<Integer> fileData = new ArrayList<Integer>();
public fileCommand(String fn) {
fileName = fn;
try {
FileInputStream fins = new FileInputStream(fileName);
DataInputStream dins = new DataInputStream(fins); while (dins.read() != -1) {
int bvalue = dins.read();
fileData.add((Integer) bvalue);
} } catch (IOException e) {
System.out.println(e); }
}
}then I extend this class and try to print it to screen but without succes.. Iam getting error "cannot find constructor"
import java.util.*;
import java.io.*;
public class fileIO extends fileCommand {
public static void main(String[] args) {
String fn = args[0];
ArrayList<Integer> fd = new ArrayList<Integer>(fn);
fd = new FileCommand(fn); for(int i= 0; i < fd.size();i++) {
System.out.println(fd.get(i));
}
}
}What Iam doing wrong? --
Thanx in advance ________________________
.
- Follow-Ups:
- Re: extending abstract class
- From: Carramba
- Re: extending abstract class
- From: Roedy Green
- Re: extending abstract class
- From: Roedy Green
- Re: extending abstract class
- Prev by Date: Re: List iterators question
- Next by Date: Re: extending abstract class
- Previous by thread: List iterators question
- Next by thread: Re: extending abstract class
- Index(es):