Hi guys
I am trying to build a program which scans data from a text file, but I keep getting an error when trying to compile it.
The code
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Scanner;
import java.io.*;
class anything extends JFrame
{
public anything()
{
File stuff = new File(stuff.txt);
Scanner scan = Scanner(stuff);
int length;
int count = 0;
double place;
while(scan.hasNextDouble())
{
place = scan.NextDouble();
count++;
}
This isn't the whole program, but is the part which has Scanner.
The errors
cannot find symbol variable txt
cannot find symbol method Scanner(java.io.File)
cannot find symbol method NextDouble()
So what is the problem, I have a feeling it has to do with the importing of scanner or something.