java基础
留一个明天
你好
展开
-
java中length,length(),size()区别
1 java中的length属性是针对数组说的,比如说你声明了一个数组,想知道这个数组的长度则用到了length这个属性. 2 java中的length()方法是针对字符串String说的,如果想看这个字符串的长度则用到length()这个方法. 3.java中的size()方法是针对泛型集合说的,如果想看这个泛型有多少个元素,就调用此方法来查看! 这个例子来演示这两个转载 2016-04-17 23:14:36 · 260 阅读 · 0 评论 -
LeetCode【1】Two Sum
问题描述 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution. 大概的意思就是给定一个数组和一个目标值,数原创 2016-04-17 23:45:42 · 221 阅读 · 0 评论 -
LeetCode【153】Find Minimum in Rotated Sorted Array
问题描述 Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element. You may assume no duplicate原创 2016-04-19 20:48:13 · 251 阅读 · 0 评论