473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Cannot find symbol

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
2 1994
Rabbit
12,516 Expert Mod 8TB
It would help to know what line number the error is on.
Oct 16 '12 #2
replace line number "14" with this code
Expand|Select|Wrap|Line Numbers
  1.  Lab06A lab= new Lab06A(); 
It will work :-)
Nov 10 '12 #3

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

Similar topics

15
by: Bjorn Jensen | last post by:
Hi! An beginner question: Pleas help me with this (-: Error (the arrow points on the s in sqrt) ===== tal.java:6: cannot find symbol symbol : method sqrt(int) location: class tal...
1
by: Shiva48 | last post by:
Thanks to Gannon11 and ro351988- Moderator. I give below the complete Java file and pls help me to rectify the errors. package com.wrox.proj2ee.ch10.app; import java.io.*; import...
1
by: jank | last post by:
hi, I wrote sending mass email program in java. If i try to compile using ant compiler, i am getting this error. c:\mail\src\com\mail\action\SendMail.java:125: cannot find symbol ...
4
by: jingchua | last post by:
Hi, can anyone help out here???? I have the below error after compling the file. Any idea what is wrong in the declaration that was done in the above code??? Appreciate any help on shedding some...
2
by: jazzyme2 | last post by:
New to Java. Working on this and ran into this problem. Any clues? java:42: cannot find symbol symbol : constructor Pay() location: class Pay Pay Emp1 = new Pay(); ^ 43:...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
10
by: CodeNoob | last post by:
please help been working on a project got it down to 5 errors from 100 now i have no idea what to do. Errors: init: deps-jar: Created dir: C:\Users\Tommy\Desktop\build\classes Compiling 306...
2
suzee_q00
by: suzee_q00 | last post by:
Compiler seems to be hanging up on "new" but I know it isn't but I can't seem to figure out what it is that it doesn't like. Been chasing my tail for the last couple of days. Any help would be...
4
by: LadiPrather | last post by:
These error say there is not symbols, I have changed them some many times till I am lost. Please someone help. JOptionPane.showMessageDialog(null,"Oringinal Balance = $" + recieveAmount + ...
1
by: JanineXD | last post by:
Hey, I seem to have a problem on a Java Swing Program with ActionListener. I've tried to use getSource in our class but seem don't have an idea why it won't work when I tried to program at...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.