谁给我做了这考试题啊!~!~!~!~!`1`

kuailezhiyuan001 2006-12-14 09:42:12
1.编制JAVA程序,定义整形数组存放10个数据,要求按升序输出
2.编制一个输出"HELLO WORLD"的程序.用两种方法实现<application,applot>
3.编写一个一个应用程序,创建3个进程,分别显示各自的时间~!!~
4.利用socket套接字类编制一段实现TCP连接的客户端程序向服务器端发送字符串"HELLO SERVER" <服务起端口9999,IP127.0.0.1>
...全文
118 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Sir_Java 2006-12-14
  • 打赏
  • 举报
回复
3.
public class ThreadTest
{
public static void main(String[] args) throws Exception
{
for(int i=0;i<3;i++)
{
new ThreadDemo().start();
Thread.sleep(500);
}
}
}

class ThreadDemo extends Thread
{
public void run()
{
System.out.println(System.currentTimeMillis());
}
}
Sir_Java 2006-12-14
  • 打赏
  • 举报
回复
2.1
class App_Hello
{
public static void main(String[] args)
{
System.out.println("Hello,World!");
}
}
2.2
import java.applet.Applet;
import java.awt.*;

public class Applet_Hello extends Applet
{
public void Paint(Graphics g)
{
g.drawString("Hello,World!",50,50);
}
}

/*
<Applet code="Applet_Hello.class" width=300 height=300></applet>
*/
Sir_Java 2006-12-14
  • 打赏
  • 举报
回复
1.import java.util.*;

class ArraySort
{
public static void main(String[] args)
{
int[] arr = new int[10];

for(int i=0;i<arr.length;i++)
{
arr[i] = (int)(Math.random()*10);
}

System.out.println("Sorted Before: ");
for(int i=0;i<arr.length;i++)
{
System.out.print(" a[" + i+"]=" + arr[i]);
}

Arrays.sort(arr);
System.out.println("Sorted After: ");
for(int i=0;i<arr.length;i++)
{
System.out.print(" a[" + i+"]=" + arr[i]);
}
}
}

23,407

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧