码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果
foreach的一个“奇怪”现象——实现原理分析
先看一个长长的代码,其实很简单,就是使用不同的方法迭代Map,对值进行修改,只要遇到foreach就发现赋值看似成功,实则失败。就想搞清楚为什么,不想直接从搜索引擎搜来别人的总结好的背下来。1、问题的引出1.1、测试的源代码1:publicstaticvoidmain(String[]args){2:Map<S..
分类:其他好文   时间:2015-04-08 16:44:53    阅读次数:220
PHP mkdir函数
今天用了mkdir函数,有报错说没有文件,查询才知道是需要递归创建文件目录。所以在手册里面好好找了下mkdir函数。boolmkdir(string$pathname[,int$mode=0777[,bool$recursive=false[,resource$context]]])第一个参数:文件的名称。第二个参数:文件的权限第三个参数:当为ture..
分类:Web程序   时间:2015-04-08 16:44:38    阅读次数:128
04-08 leetcode-12 Integer to Roman
?? 问题描述:Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to3999. 问题分析:类似于十进制,从高位进行计算即可 代码: public class Solution { public String intTo...
分类:其他好文   时间:2015-04-08 16:36:44    阅读次数:99
得到当前方法的名字Thread.currentThread().getStackTrace()[1].getMethodName();
得到当前方法的名字 String methodName = Thread.currentThread().getStackTrace()[1].getMethodName(); getStackTrace()返回一个表示该线程堆栈转储的堆栈跟踪元素数组。如果该线程尚未启动或已经终止,则该方法将返回一个零长度数组。如果返回的数组不是零长度的,则其第一个元素代表堆栈顶,它是该序列中最新的方法调...
分类:其他好文   时间:2015-04-08 16:26:38    阅读次数:179
[leetcode]Word Break II
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, given s = “catsanddo...
分类:其他好文   时间:2015-04-08 16:25:24    阅读次数:164
java提高篇(二十)-----集合大家族
在编写java程序中,我们最常用的除了八种基本数据类型,String对象外还有一个集合类,在我们的的程序中到处充斥着集合类的身影!java中集合大家族的成员实在是太丰富了,有常用的ArrayList、HashMap、HashSet,也有不常用的Stack、Queue,有线程安全的Vector、Ha....
分类:编程语言   时间:2015-04-08 16:21:02    阅读次数:202
Java 的读取文件
Java 读文件 先用 File f = new File("文件的位置"); 然后 BufferedReader reader = new BufferedReader (new FileReader(f)); String s = reader.readLine()...
分类:编程语言   时间:2015-04-08 16:18:51    阅读次数:112
Leetcode:Palindrome Partitioning
Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For example, given s = "aab", Return [ ["aa","...
分类:其他好文   时间:2015-04-08 15:06:58    阅读次数:79
做javaEE项目中常用的工具类中的方法!
一: 把时间Date类型转换成String类型1 /** 2 * 把Date类型转换成String类型 3 * @param date 4 * @return 5 */ 6 public static String dateToString(Date...
分类:编程语言   时间:2015-04-08 14:56:42    阅读次数:217
C#OpenFileDialog使用(转)
string resultFile = ""; OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = "D:\\Patch"; openFileDialog1.Filte.....
分类:Windows程序   时间:2015-04-08 14:54:52    阅读次数:148
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!