for each...in 使用一个变量迭代一个对象的所有属性值,对于每一个属性值,有一个指定的语句块被执行. for each...in 是 ECMA-357 (E4X) 标准的一部分, 大部分非Mozilla浏览器都没有实现该标准, E4X并不是 ECMAScript 标准的一部分. 作为ECM ...
分类:
其他好文 时间:
2018-11-10 14:56:44
阅读次数:
209
java.util.Arrays.binarySearch() method public static int binarySearch(int[] a, int key) Parameters * a ? This is the array to be searched. * key ? Thi... ...
分类:
其他好文 时间:
2018-11-08 18:13:41
阅读次数:
85
今天用到了这个方法,就来写写相关的注意事项. 1.Arrays.asList()方法对基本数据类型数组是会出现bug的.如果要用到像int,double这类的一定要转化成包装类来使用.因为asList的源码是泛型化的参数,而基本数据类型是不支持泛型化的,但数组是支持的. 2.Arrays.asLis ...
分类:
其他好文 时间:
2018-11-08 16:24:15
阅读次数:
138
集合 创建集合时不跟泛型 编译器检查不出元素的类型,取元素时需要 强转 ,若强转类型不对则报异常 使用Arrays.asList()生成的List 进行add()或delet()操作运行时会出异常,因为Arrays.asList()的底层为数组,长度不可改变 分类 Collection 1. Lis ...
分类:
其他好文 时间:
2018-11-08 13:44:57
阅读次数:
169
创建组件: Servlet public class TxServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Ser ...
分类:
编程语言 时间:
2018-11-08 01:08:44
阅读次数:
364
java.util.ArrayList是十分常用的容器之一,本文针对其常用方法,对其进行简单的研究。ArrayList常见方法如下,主要还是增删改查: 首先,看一下ArrayList中如何保存数据的: 所以,所有的数据都是保存在数组里的。当然,数组都有个大小: 若ArrayList使用无参构造函数实 ...
分类:
编程语言 时间:
2018-11-07 23:09:44
阅读次数:
173
https://leetcode.com/problems/merge-sorted-array/description/ Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted ar ...
分类:
其他好文 时间:
2018-11-07 19:54:56
阅读次数:
144
1 public static void main(String agrs[]){ 2 int arr[]=new int[5]; 3 4 Arrays.fill(arr,8);//t填充的效果 5 6 for(int i=0;i<arr.length;i++){ 7 System.out.... ...
分类:
其他好文 时间:
2018-11-06 19:42:51
阅读次数:
149
You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element from th... ...
分类:
其他好文 时间:
2018-11-06 11:22:59
阅读次数:
191
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh ...
分类:
其他好文 时间:
2018-11-06 01:01:10
阅读次数:
207