Would anyone please explain why I am getting this error? Not just this one
Constructor 'StockMachine(java.lang.String)' is never used
but also one that says Method is never used. I am not entirely sure why this is happening. Here is a snippet of my code:
import java.io.*;
import java.util.*;
import java.io.FileInputStream;
public class StockMachine {
private StockPriceService [] stockPriceServices;
private String tickerSymbols[];
private final int NUMBEROFSERVICES = 3;
public StockMachine(String fileName) {
stockPriceServices = new StockPriceService[3];
stockPriceServices[0] = new UHStockService();
stockPriceServices[1] = new NLPService();
stockPriceServices[2] = new ExternalService();
try {
FileInputStream fis = new FileInputStream(fileName);
Scanner scan = new Scanner(fis);
this.tickerSymbols = new String[scan.nextInt()];
int i = 0;
while (scan.hasNext()) {
this.tickerSymbols[i] = scan.next();
i++;
}
}
catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}