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 2 of 2

Thread: im trying my second hello world program and im getting errors?

  1. #1
    Junior Member
    Join Date
    Oct 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default im trying my second hello world program and im getting errors?

    so im trying to learn the basics of java from a book called learn java in 21 days i got the free pdf and im stuck on this code

    1: import java.awt.Graphics;
    2:
    3: class HelloWorldApplet extends java.applet.Applet {
    4:
    5: public void paint(Graphics g) {
    6: g.drawString(“Hello world!”, 5, 25);
    7: }
    8:}

    of course i remove the number and the colons but it still wont compile it, i did some research and i found one that works the code for that one is

    import java.applet.Applet;
    import java.awt.Graphics;

    public class HelloWorld extends Applet {
    public void paint(Graphics g) {
    g.drawString("Hello world!", 50, 25);
    }
    }
    now i dont just wanna learn from remembering not to do this or that i want to know why it doesnt work i waant to understand whats happening here can any one help? please explain in detail.


  2. #2
    Junior Member
    Join Date
    Aug 2014
    Location
    Kentucky
    Posts
    11
    My Mood
    Worried
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: im trying my second hello world program and im getting errors?

    You may want to start by putting your code into the proper syntax, check above. I find it easier starting with a compiling IDE program like netbeans and going with the basics. Look at the tutorials on the website or download/purchase a book like Java Programming for Dummies. It appears to be good, unfortunately I am trying to learn at my professors pace and it's frustrating. Good luck and welcome.

Similar Threads

  1. Replies: 1
    Last Post: February 28th, 2014, 02:08 AM
  2. Program errors because it cannot find something it shouldnt be looking for
    By CrazyCrinkle in forum Object Oriented Programming
    Replies: 3
    Last Post: July 3rd, 2013, 01:11 PM
  3. Java Program Help! Cant find errors
    By frenchsasha in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 6th, 2013, 10:30 AM
  4. Simple program with errors
    By mstratmann in forum What's Wrong With My Code?
    Replies: 2
    Last Post: September 30th, 2012, 11:26 AM
  5. [SOLVED] Could someone help me find my errors on this program?? (homework)
    By r19ecua in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 20th, 2011, 10:25 PM