By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,654 Members | 1,517 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,654 IT Pros & Developers. It's quick & easy.

Cannot find symbol

P: 1
Expand|Select|Wrap|Line Numbers
  1. import java.util.Scanner;
  2. import java.io.*;
  3.  
  4. public class Lab06A
  5. {
  6.     private String name;
  7.     private int age;
  8.     private int year;
  9.  
  10.  
  11.     public static void main(String[]args)
  12.         {
  13.  
  14.         Lab06A = new Lab06A();
  15.         lab.input();
  16.         lab.process();
  17.         lab.output();
  18.  
  19.     }
  20.  
  21.     public void input()
  22.         {
  23.        try 
  24.        {
  25.            Scanner reader = new Scanner(new File("lab06a.dat"));
  26.            name = reader.next();
  27.            reader.useDelimiter("/|\r\n");
  28.            age = reader.nextInt();
  29.            }
  30.            catch (FileNotFoundException e )
  31.            {
  32.                System.out.println("Error opening data file!");
  33.                System.exit(0);
  34.           }
  35.  
  36.  
  37.     }
  38.     public void process()
  39.         {
  40.             year = 2012-age;
  41.  
  42.         }
  43.     public void output()
  44.     {
  45.         System.out.println(name+"you were born in"+year);
  46.     }
  47. }


It tells me it cannot find the symbol.
Oct 16 '12 #1
Share this Question
Share on Google+
2 Replies


Rabbit
Expert Mod 10K+
P: 12,421
It would help to know what line number the error is on.
Oct 16 '12 #2

P: 21
replace line number "14" with this code
Expand|Select|Wrap|Line Numbers
  1.  Lab06A lab= new Lab06A(); 
It will work :-)
Nov 10 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.