再说大家普遍接触到的第一个application例子:Hello World
public class helloworld{ public static void main(String args[]) { try{ System.out.println("helloworld!"); System.out.println("press any key to continue.."); System.in.read(); }catch(Exception e){} } }
首先是什么?
先把文件保存为helloworld.java,然后配置好jdk的path和classpath路径,可忙了一下午怎么都没配好,于是把copy helloworld.java到jdk/bin目录,再cd到此目录下cmd运行javac+java之后才正式看到了
helloworld!
press any key to continue..
虽然累,可心情还是非常激动的,毕竟我手下的第一个java application运行出来了!
接着是第二个applet,出乎意料,我的第一个applet在一分钟内就诞生了

import java.awt.*; import java.applet.Applet; public class HelloApplet extends Applet { String s; public void init(){ String temps; temps=getParameter("name"); s="everyone"; if(temps!=null) { s=temps; } } public void paint(Graphics g) {g.drawString("hello,"+s,size().width/3,size().height/2); } }
html可是我的强项,于是成果出来了
me first applet