I am using Scanner and BufferedReader objects to read text input from a url, and am getting this compile time error: no suitable constructor found for Scanner.
any suggestions would be appreciated, here is the code:
import java.util.Scanner;
import java.net.*;
import java.io.*;
import java.util.Arrays;
import java.lang.*;
public class Processor
{
public void start(){
readInput();
sort();
writeOutput();
}
public void readInput()
{
Scanner scan = new Scanner();
URL file = new URL("http://file.txt");
BufferedReader reader=new BufferedReader(new InputStreamReader(file.openStream()));
Customer[] customerList = new Customer[40000];
scan.nextLine();
Scanner class doesnt have a default constructor,
See this doc
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Scanner.html
For example, this code allows a user to read a number from System.in: