Results 1 to 3 of 3
  1. #1
    ehsan is offline Member
    Join Date
    Jul 2011
    Posts
    10
    Rep Power
    0

    Default Java Class Error

    Hi Everyone . I'm beginner in Java and use Ubuntu 11.4

    I created Class Event and Then Create UseSimpleEvent File For Create object (Created 2 File ) .
    public class Event
    {
    private int eventGuests;
    public void displayEventGuests()
    {
    JOptionPane.showMessageDialog(null, "Event Guests :"+ eventGuests);
    }
    public void inputEventGuests()
    {
    char inChar;
    String guestsString = new String("");
    guestsString = JOptionPane.showInputDialog(null,
    "Enter the Number of guests at your Event ");
    eventGuests = Integer.parseInt(guestsString);
    }
    }


    public class UseSimpleEvent {


    public static void main(String[] args) {
    Event anEvent = new Event();
    anEvent.inputEventGuests();
    anEvent.displayEventGuests();

    }
    }


    I can compile Event.java without Error , but When I want to compile UseSimpleEvent.java my compiler return Error That

    UseSimpleEvent.java:5: cannot find symbol
    symbol : class Event
    location: class UseSimpleEvent
    Event anEvent = new Event();
    ^
    UseSimpleEvent.java:5: cannot find symbol
    symbol : class Event
    location: class UseSimpleEvent
    Event anEvent = new Event();
    ^
    2 errors

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,847
    Rep Power
    8

    Default

    Crossposted: Class Error
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. Java Class Not Found Error?
    By Ethan in forum New To Java
    Replies: 0
    Last Post: 03-20-2011, 06:33 PM
  2. Error: The java class is not found:
    By Karthika in forum New To Java
    Replies: 2
    Last Post: 01-14-2011, 06:03 AM
  3. Compilation Error in basic java class
    By ruchir123 in forum New To Java
    Replies: 7
    Last Post: 11-21-2010, 11:23 PM
  4. Java Error Class Help !!
    By rons_sacramental in forum New To Java
    Replies: 2
    Last Post: 05-10-2010, 02:42 AM
  5. Replies: 1
    Last Post: 08-02-2007, 04:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •