Cannot find symbol

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chubschub
    New Member
    • Oct 2012
    • 1

    Cannot find symbol

    Code:
    import java.util.Scanner;
    import java.io.*;
    
    public class Lab06A
    {
    	private String name;
    	private int age;
    	private int year;
    
    	
    	public static void main(String[]args)
    		{
    		
    		Lab06A = new Lab06A();
    		lab.input();
    		lab.process();
    		lab.output();
    		
    	}
        
        public void input()
        	{
           try 
           {
           	Scanner reader = new Scanner(new File("lab06a.dat"));
           	name = reader.next();
           	reader.useDelimiter("/|\r\n");
           	age = reader.nextInt();
           	}
           	catch (FileNotFoundException e )
           	{
           		System.out.println("Error opening data file!");
           		System.exit(0);
          	}
     
     
        }
        public void process()
            {
            	year = 2012-age;
            	
            }
        public void output()
        {
        	System.out.println(name+"you were born in"+year);
        }
    }


    It tells me it cannot find the symbol.
    Last edited by Rabbit; Oct 16 '12, 04:37 AM. Reason: Please use code tags when posting code.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    It would help to know what line number the error is on.

    Comment

    • neeraj0708
      New Member
      • Feb 2012
      • 21

      #3
      replace line number "14" with this code
      Code:
       Lab06A lab= new Lab06A();
      It will work :-)

      Comment

      Working...