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.