Works System的笔试
来源:互联网 发布:量化数据分析 股票 编辑:程序博客网 时间:2024/06/02 05:23
第一次参加笔试,心情当然不一样!虽然结果在意料之中,但是学到了很多有用的东西!
Java笔试采用全英文,考的内容很基础,也有几题难度较大的编程。
有几题是这样的:
用Java编写一个关于TCP协议的Server与Cilent的程序、说说你对Struts中MVC框架的理解、
写一个Java Bean,必须包含三个members
程序题就这些;还有些选择回答之类的:
显示www.google.com 的IP,用什么命令、什么是SNMP、VPN等。
看来我自己所了解的东西还是很少,前方的路啊,还是伸手不见五指的!
解答:
ipconfig :使用它来显示计算机中网络适配器的IP地址、子网掩码和默认网关。
可以带参数 /all 、/batch 、/release N 、/renew N
基于TCP的网络编程:
先定义一个Server类
Server.java
import java.io.*;
import java.net.*;
class Server{
public static void main(String arg[]) throw Exception
{ ServerSocket Serv=new ServerSocket(1999);
System.out.println("Detect the 1999 of this computer");
Socket Clin;
Clin=Serv.accept();
System.out.println("One customer have connected this computer");
InputStream in=Ciln.getInputStream();
OutputStream out=Ciln.getOutputStream();
//将原始数据流封装
BufferedReader br=new BufferedReader( new InputStreamReader(in) );
PrintStream ps=new PrintStream(out);
String msg;
while( ( msg=br.readline() )!=null ){
System.out.println("Server recieved :" + msg);
ps.println( msg ); //输出到客户端Clin
if( msg.equals("quit") ) { //如果客户端发送quit信息,则退出
System.out.println("Server program end");
break;
}
}
in.close();
out.close();
Clin.close();
}
}
接着定义一个Client类
Client.java
import java.io.*;
import java.net.*;
class Client{
public static void main(String arg[]) throws Exception
{ Socket Clin=new Socket("127.0.0.1",1999);
System.out.println("Client have connected the Server ");
InputStream in=Clin.getInputStream();
OutputStream out=Clin.getOutputStream();
BufferedReader br1=new BufferedReader(new InputStreamReader(in));
PrintStream ps=new PrintStream(out);
BufferedReader br2=new BufferedReader(new InputStreamReader(System.in));
String msg;
while((msg=br2.readLine())!=null) {
ps.println(msg);
System.out.println("Sent to Server:"+msg);
System.out.println("Client recieved the new:"+br1.readLine());
if(msg.equals("quit")){
System.out.println("Client is end");
in.close();
out.close();
Clin.close();
break;
}
}
}
}
- Works System的笔试
- Works Applications的笔试题
- Works Applications 面试笔试!
- 0.033秒的艺术 --- Know How System.Math Works
- Works Application 2017 笔试题
- TempData may not works under distributed system
- how the Android IPC system works
- how the Android IPC system works
- How property system works on Android
- How property system works on Android
- How System.out.println() really works
- How System.out.println() really works
- ADB-How it works---system-core-adb
- Works applications 2014笔试题(1)
- Works applications 笔试题(2)
- Works applications 笔试题(3)
- Works Application 2017 笔试 [Exam2] Wireless Routers
- Maigc Cubes:2017 Works Application笔试
- 如何在.NET中访问MySQL数据库
- MySQL与ASP.NET配合更强大
- 学习线程(Thread)有感
- 自言自语
- 仿生:数据库可能的一种进化之道
- Works System的笔试
- eXCHANGEkEY
- Java/JSP中文乱码问题解决心得
- 端口扫描程序nmap使用手册
- 给数组赋初值
- 想玩转bash吗? 那么进入bash编程教学
- Radeditor5.6的破解
- 21世纪遥感与GIS的发展
- 单链表的就地逆置.