• Java 面试题


    hashMap与hashTable的区别

    • 继承类不同:hashMap、hashTable都是Map接口的实现类,但是hashMap类继承自抽象类abstractMap类,hashTable继承自
      Dictionary类(且以过时)
    • 线程安全:hashTable里面的方法都是同步的,实现同步的方法是synchronized,hashMap是非同步的,但也可以使用Collections
      类中的静态方法使其变得同步
    • NULL:hashTable不允许有null的键和值,hashMap允许有空的键和值
    • 初始容量不同:hashMap是16,hashTable为11

    SpringMVC过程

    1、 用户发送请求至前端控制器DispatcherServlet。
    2、 DispatcherServlet收到请求调用HandlerMapping处理器映射器。
    3、 处理器映射器找到具体的处理器(可以根据xml配置、注解进行查找),生成处理器对象及处理器拦截器(如果有则生成)一并返回给DispatcherServlet。
    4、 DispatcherServlet调用HandlerAdapter处理器适配器。
    5、 HandlerAdapter经过适配调用具体的处理器(Controller,也叫后端控制器)。
    6、 Controller执行完成返回ModelAndView。
    7、 HandlerAdapter将controller执行结果ModelAndView返回给DispatcherServlet。
    8、 DispatcherServlet将ModelAndView传给ViewReslover视图解析器。
    9、 ViewReslover解析后返回具体View。
    10、DispatcherServlet根据View进行渲染视图(即将模型数据填充至视图中)。
    11、 DispatcherServlet响应用户。

    String和int直接转换

    string转换成int :Integer.valueOf("12")
    int转换成string : String.valueOf(12)

  • 相关阅读:
    Windows统一平台: 开发小技巧
    How to install more voices to Windows Speech?
    Why does my ListView scroll to the top when navigating backwards?
    中文圣经 for Android
    [ CodeVS冲杯之路 ] P1166
    [ CodeVS冲杯之路 ] P1154
    [ CodeVS冲杯之路 ] P1048
    [ CodeVS冲杯之路 ] P1063
    [ CodeVS冲杯之路 ] P3027
    理解矩阵乘法
  • 原文地址:https://www.cnblogs.com/xiongyungang/p/13823868.html
Copyright © 2020-2023  润新知