发布网友
共3个回答
热心网友
applet的hello world
在jsp项目下新建一jsp文件,全部代码如下:
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="gb2312"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>applet 的hello world程序</title>
</head>
<body>
<applet alt="applet 的hello world程序" code="HelloWorld.class" width="200" height="100"></applet>
</body>
</html>
在源文件里写一小应用程序HelloWorld.java
全部代码如下:
import java.applet.Applet;
import java.awt.Graphics;
public class HelloWorld extends Applet {
public void paint(Graphics g)
{
g.drawString("hello world", 6, 36);
}
}
将生成的类文件拷贝到jsp相同的目录下,运行jsp文件查看效果!
2.Application的 :
public class HelloWord {
public static void main(String[] args) {
System.out.println("HEllo wrod!!!");
}
}
热心网友
只会Application方式:
classic Dashu{
public static void main(String[] args){
System.out.print("hello world");
}
}
热心网友
#include<stdio.h>
int main()
{
printf(hello world!\n);
return 0;
}
热心网友
applet的hello world
在jsp项目下新建一jsp文件,全部代码如下:
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="gb2312"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>applet 的hello world程序</title>
</head>
<body>
<applet alt="applet 的hello world程序" code="HelloWorld.class" width="200" height="100"></applet>
</body>
</html>
在源文件里写一小应用程序HelloWorld.java
全部代码如下:
import java.applet.Applet;
import java.awt.Graphics;
public class HelloWorld extends Applet {
public void paint(Graphics g)
{
g.drawString("hello world", 6, 36);
}
}
将生成的类文件拷贝到jsp相同的目录下,运行jsp文件查看效果!
2.Application的 :
public class HelloWord {
public static void main(String[] args) {
System.out.println("HEllo wrod!!!");
}
}
热心网友
只会Application方式:
classic Dashu{
public static void main(String[] args){
System.out.print("hello world");
}
}
热心网友
#include<stdio.h>
int main()
{
printf(hello world!\n);
return 0;
}