Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: object error cannot find symbol question

  1. #1
    Junior Member
    Join Date
    Jun 2014
    Location
    FL
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default object error cannot find symbol question

    I'm not sure if I am doing something wrong or what but I can not get this to run
    it gives me an error on lines everytime there is an object ch as line 3. with error "cannot find symbol"

    I dont understand

    public class EmployeeDemo {
        public static void main(String[] args) {
            Employee e1 = new Employee();
            e1.name = "John";
            e1.ssn = "555-12-345";
     
     
            Employee e2 = new Employee();
            e2.name = "Tom";
            e2.ssn = "456-78-901";
            e2.yearOfBirth = 1974;
     
            System.out.println("Name: " + e1.name);
            System.out.println("SSN: " + e1.ssn);
            System.out.println("Year Of Birth: " + e1.yearOfBirth);
     
            System.out.println("Name: " + e2.name);
            System.out.println("SSN: " + e2.ssn);
            System.out.println("Year Of Birth: " + e2.yearOfBirth);
     
        }


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,337
    Thanks
    182
    Thanked 830 Times in 773 Posts
    Blog Entries
    5

    Default Re: object error cannot find symbol question

    Please post the full error message, and you did not post the Employee class - where is this class? Can the compiler find it?

  3. #3
    Junior Member
    Join Date
    Jun 2014
    Location
    FL
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: object error cannot find symbol question

    That answered a lot. Maybe I didn't go through the tutorial correctly or something. But it does help me understand a little more about connecting files because originally I didn't think there was another file I thought there was only a single to that tutorial. I will have to go back and reread.

Similar Threads

  1. Cannot Find symbol error! On new Object
    By jtrtoday in forum What's Wrong With My Code?
    Replies: 5
    Last Post: February 15th, 2012, 12:32 PM
  2. [SOLVED] cannot find symbol error
    By Topflyt in forum What's Wrong With My Code?
    Replies: 9
    Last Post: November 5th, 2011, 08:57 AM
  3. Cannot find symbol ERROR
    By yacek in forum What's Wrong With My Code?
    Replies: 8
    Last Post: October 21st, 2011, 11:39 PM
  4. error :cannot find symbol
    By iswan in forum AWT / Java Swing
    Replies: 1
    Last Post: October 1st, 2011, 08:26 AM
  5. cannot find symbol Error
    By bananasplitkids in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 9th, 2010, 01:36 AM