| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1539 人关注过本帖
标题:一些很简单的题目
取消只看楼主 加入收藏
大嘴先生2
Rank: 1
等 级:新手上路
威 望:2
帖 子:815
专家分:0
注 册:2006-4-17
收藏
 问题点数:0 回复次数:8 
一些很简单的题目
要求:
1。编写一个类,类中实现一个整数的阶乘运算方法,并且在运算结果超出数值的表达范围时抛出一个用户自定义异常。(数值表达范围:0<X<10000)
2.开发一个自定义的文本框构件。要求这个文本框可以检查输入的合法性(既只显示数字,而其他字符不予显示),并且抛出一个InvalidateInputException的用户自定义异常。
3.利用FileInputStream和FileOutputSteam编写一个文件拷贝的程序
4。利用AWT构件实现三级菜单程序
5。编写一个多线程程序,同时开6个线程,设置他们为线程优先级,分别进行计数到1000,并且显示在Applet上
6,编写一个利用UDP通信程序,利用DatagramSocket和DategramPacket发送方将字符串12345678990发送到接收方。
7。编写一个TCP通信服务端的代码,要求该服务端在端口4000提供服务,可以支持多线程,能同时为多个客户端进行服务(服务的内容为向客户端发送字符串“hello!”)
搜索更多相关主题的帖子: 构件 合法性 多线程 文本框 
2007-06-27 12:26
大嘴先生2
Rank: 1
等 级:新手上路
威 望:2
帖 子:815
专家分:0
注 册:2006-4-17
收藏
得分:0 
xiexie !

骑白马的未必是王子,也可能是唐僧;有翅膀的未必是天使,也可能是鸟人。
2007-06-28 20:18
大嘴先生2
Rank: 1
等 级:新手上路
威 望:2
帖 子:815
专家分:0
注 册:2006-4-17
收藏
得分:0 
关键是没时间敲,哈哈!

骑白马的未必是王子,也可能是唐僧;有翅膀的未必是天使,也可能是鸟人。
2007-06-28 20:18
大嘴先生2
Rank: 1
等 级:新手上路
威 望:2
帖 子:815
专家分:0
注 册:2006-4-17
收藏
得分:0 

晕死
我敲了
第三题有点问题!
//利用FileInputStream和FileOutputSteam编写一个文件拷贝的程序
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.*;
import java.nio.channels.FileChannel;
class Copy
{
String filename = null;
String path = "456";
File file =null;
String objFilename = null;
File objfile = null;
FileOutputStream output = null;
FileInputStream input = null;
FileChannel inputchannel = null;
FileChannel outputchannel = null;
File pathfile=null;
File yuanfile = null;
File bojectfile = null;
Copy(String yuan,String obj)
{
pathfile = new File(path);
yuanfile = new File(yuan);
bojectfile = new File(obj);
filename = yuan;
objFilename = obj;
file = new File(path,filename);
objfile = new File(path,objFilename);
judge(pathfile,file);
judge(pathfile,objfile);
read();
write();
}
public void judge(File pathfile,File file) //判确定文件存在
{
if(pathfile.isDirectory()==false)
{
pathfile.mkdirs();
}
if(file.isFile()==false)
{
try
{
file.createNewFile();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
public void read() //读文件
{
try
{
input = new FileInputStream(file);
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
ByteBuffer buf = ByteBuffer.allocate(200);
inputchannel = input.getChannel();
try
{
inputchannel.read(buf);
}
catch (IOException e)
{
System.out.println(e.toString());
}
buf.flip();
System.out.println("文件内容:");
//System.out.println(buf.get());
try //关闭流
{
input.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
public void write() //写文件
{
try
{
output = new FileOutputStream(objfile);
}
catch (FileNotFoundException e1)
{
e1.printStackTrace();
}
ByteBuffer buf = ByteBuffer.allocate(200);
outputchannel = output.getChannel();
try
{
inputchannel.write(buf);
}
catch (IOException e)
{
System.out.println(e.toString());
}
buf.flip();
System.out.println("文件写入完成");
try
{
output.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
public String toString()
{
return "完成";
}
public static void main(String args[]) //主方法
{
String yuan="123.txt";
String obj="456.txt";
Copy copy = new Copy(yuan,obj);
//System.out.println(copy.toString());
}
}


骑白马的未必是王子,也可能是唐僧;有翅膀的未必是天使,也可能是鸟人。
2007-06-30 11:36
大嘴先生2
Rank: 1
等 级:新手上路
威 望:2
帖 子:815
专家分:0
注 册:2006-4-17
收藏
得分:0 
看看,一个代码就这么长!~~
大家给我看看,结果有点问题!

骑白马的未必是王子,也可能是唐僧;有翅膀的未必是天使,也可能是鸟人。
2007-06-30 11:37
大嘴先生2
Rank: 1
等 级:新手上路
威 望:2
帖 子:815
专家分:0
注 册:2006-4-17
收藏
得分:0 
以下是引用千里冰封在2007-6-30 11:51:54的发言:
你不写,永远不会进步

谁说我没写
能帮我看看错哪了吗?!


骑白马的未必是王子,也可能是唐僧;有翅膀的未必是天使,也可能是鸟人。
2007-06-30 11:57
大嘴先生2
Rank: 1
等 级:新手上路
威 望:2
帖 子:815
专家分:0
注 册:2006-4-17
收藏
得分:0 
其实我很多都写过
这回是帮别人做
自己写太累了
我写了前4题
要是谁给我点想法也好,写的头都疼

骑白马的未必是王子,也可能是唐僧;有翅膀的未必是天使,也可能是鸟人。
2007-06-30 12:00
大嘴先生2
Rank: 1
等 级:新手上路
威 望:2
帖 子:815
专家分:0
注 册:2006-4-17
收藏
得分:0 
哎!~~~
你不知道
现在java学完了
正学oracle呢
复习都没时间
要赶进度
假期都没得过了

骑白马的未必是王子,也可能是唐僧;有翅膀的未必是天使,也可能是鸟人。
2007-06-30 12:07
大嘴先生2
Rank: 1
等 级:新手上路
威 望:2
帖 子:815
专家分:0
注 册:2006-4-17
收藏
得分:0 
那是
不过我的主要据说不是计算机
学好日语就好赚钱
但是计算机水平愈高,工资愈多!

骑白马的未必是王子,也可能是唐僧;有翅膀的未必是天使,也可能是鸟人。
2007-06-30 12:13
快速回复:一些很简单的题目
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026746 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved