编写JAVA程序,编写一个输出“Hello World!”的程序,谢谢大家的帮忙,请大家来看看

发布网友

我来回答

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;
}

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com