Results 1 to 5 of 5
  1. #1
    ooooohmaul is offline Member
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    Default Need Help - Beginner

    Thanks for reading this people. Whenever i try compiling this:

    Java Code:
    public class HelloApp2
    {
    	public static void main (String[] args)
    	{
    		Greeter myGreeterObject = new Greeter();
    		myGreeterObject.sayHello();
    	}	
    }

    It always gives me 2 errors saying HelloApp2:java:10 cannot find symbol

    Please help me i've been stuck on this for hours.
    Last edited by Fubarable; 08-08-2010 at 01:21 AM. Reason: Moderator Edit: Code tags added

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    When posting error messages, it's always best to post the exact error message.
    I'm guessing though it's the line with Greeter stuff on it. Have you created a Greeter class yet? Does it compile correctly?

    edit: also, I added code tags to your post. To learn how this is done, please see the link in my signature about this.

    Luck!

  3. #3
    jankidudel is offline Member
    Join Date
    Jul 2010
    Posts
    5
    Rep Power
    0

    Default

    Well, if you think that it is enough to create an object of the class which doesn't exist and call non existing method and expect something good to happen, then you are certainly wrong(if you don't missed some code here).
    Java Code:
    public class HelloWorld {
        public static void main(String[] args) {
            Greeter myGreeterObject = new Greeter();
            myGreeterObject.sayHello();
        }
    }
    
    [COLOR="Red"]class Greeter {
        void sayHello() {
            System.out.println("Hello, Java");
        }
    }[/COLOR]

  4. #4
    ooooohmaul is offline Member
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    Default

    Ty for replies, i made a greeter class now, and it compiled perfectly. Then i tried recompiling my same code, and it worked! Thanks a lot for your help. Btw, i'll be posting here when i have more problems if you dont mind :S. I'm only 14, i'm just trying to learn.

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

    Default

    Quote Originally Posted by ooooohmaul View Post
    Btw, i'll be posting here when i have more problems if you dont mind :S. I'm only 14, i'm just trying to learn.
    No one complain that, you can post many as you want. Choose the correct sub-forum and post your question in much descriptive way.

Similar Threads

  1. Beginner, need a little help
    By jimmy-lin in forum New To Java
    Replies: 6
    Last Post: 10-10-2009, 02:00 AM
  2. beginner here...help please
    By shroomiin in forum New To Java
    Replies: 6
    Last Post: 09-16-2009, 12:06 AM
  3. Beginner needs help!
    By Polyy in forum New To Java
    Replies: 1
    Last Post: 11-27-2008, 06:12 AM
  4. almost done...beginner needs help plz..
    By shongo in forum New To Java
    Replies: 15
    Last Post: 11-10-2008, 09:14 AM
  5. beginner needs help with OBD-II input
    By andrewos in forum New To Java
    Replies: 3
    Last Post: 07-30-2007, 10:46 AM

Posting Permissions

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