用户名: 密码: 企业 个人
当前位置:89学习网范文文章招聘应聘笔试微薄C语言招聘笔试题» 正文

微薄C语言招聘笔试题

[10-16 20:00:41]   来源:http://www.89xue.com  笔试   阅读:90
摘要:7.ArrayList和Vector的区别,HashMap和Hashtable的区别?答:就ArrayList与Vector主要从二方面来说.一.同步性:Vector是线程安全的,也就是说是同步的,而ArrayList是线程序不安全的,不是同步的二.数据增长:当需要增长时,Vector默认增长为原来一培,而ArrayList却是原来的一半就HashMap与HashTable主要从三方面来说。一.历史原因:Hashtable是基于陈旧的Dictionary类的,HashMap是Java 1.2引进的Map接口的一个实现二.同步性:Hashtable是线程安全的,也就是说是同步的,而HashMap是线程序不安全的,不。
微薄C语言招聘笔试题,标签:笔试范文,http://www.89xue.com

  7.ArrayList和Vector的区别,HashMap和Hashtable的区别?

  答:就ArrayList与Vector主要从二方面来说.

  一.同步性:Vector是线程安全的,也就是说是同步的,而ArrayList是线程序不安全的,不是同步的

  二.数据增长:当需要增长时,Vector默认增长为原来一培,而ArrayList却是原来的一半

  就HashMap与HashTable主要从三方面来说。

  一.历史原因:Hashtable是基于陈旧的Dictionary类的,HashMap是Java 1.2引进的Map接口的一个实现

  二.同步性:Hashtable是线程安全的,也就是说是同步的,而HashMap是线程序不安全的,不是同步的

  三.值:只有HashMap可以让你将空值作为一个表的条目的key或value

  8.简述一下MVC模式的工作原理。

  三、程序题:

  1.写一个Servlet 输出HelloWorld,并写出在web.xml中的配置。

  参考答案:

  public class HelloServlet extends HttpServlet{

  public void doGet(HttpServletRequest request, HttpServletResponse response){

  PrintWriter pw = response.getWriter();

  pw.println("HelloWorld");

  pw.close();

  }

  public void doPost(HttpServletRequest request, HttpServletResponse response){

  doGet(request,response);

  }

  }

  

  HelloServlet

  com.softeem.HelloServlet

  

  

  HelloServlet

  /HelloServlet

  

  2.写出MVC2的中央控制器核心代码。

  参考答案:

  String path = request.getRequestURI();

  int start = path.lastIndexOf(“/”) + 1;

  int end = path.lastIndexOf(“.”);

  String pathName = path.subString(start,end);

  ActionConfig config = (ActionConfig)MVCConfig.getConfig().getMap().get(pathName);

  Action action = (Action)Class.forName(config.getPath()).newInstance();

  String forward = action.execute(request,response);

  if(config.getRedirect().qualsIgnoreCase(“true”)){

  response.sendRedirect(forward);

  }else{

  RequestDispatcher rd = request.getRequestDispatcher(forward);

  rd.forward(request,response);

  }

  二分法:

  int search(DataType t) {

  02

  int l,u,m;

  03

  l = 0;

  04

  u = n -1 ;

  05

  while (l <= u) {

  06

  m = (l + u) /2 ;

  07

  if (x[m] < t) {

  08

  l = m + 1;

  09

  } else if(x[m] == t) {

  10

  return m;

  11

  } else {

  12

  u = m - 1;

  13

  }

  14

  }

  15

  return -1 ;

  16

  }

上一页  [1] [2] [3] [4] 


Tag:笔试笔试范文招聘应聘 - 笔试