码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果)
算法题:找出一个数组中依次最大的k个元素
package arithmetic;import java.util.Arrays;/** * 找出一个数组中依次最大的k个元素 * @author SHI */public class FindMaxFigure { public static void main(String[] arg...
分类:编程语言   时间:2015-01-27 23:18:27    阅读次数:175
File Input and Output
Assume ifle and ofile is the string object storing the names of input and output files' names.string ifile = "inputFile.txt";string ofile = "outputFil...
分类:其他好文   时间:2015-01-27 23:14:54    阅读次数:343
一天一段scala代码(-)
一天一段scala代码(-)        为了更好的驾驭spark,最近在学习scala语言特性,主要看《快学scala》,顺便把一些自己认为有用的代码记下来。 package examples object Example1 { def main(args: Array[String]) { //val用于声明可变变量 var coun...
分类:其他好文   时间:2015-01-27 21:52:29    阅读次数:210
String,StringBuffer与StringBuilder的区别??
转自:----转自----:转自----:转自----:转自----:转自----:转自----:转自----:转自----:转自----:转自----:转自----:转自----:String 字符串常量StringBuffer 字符串变量(线程安全)StringBuilder 字符串变量(非线程...
分类:其他好文   时间:2015-01-27 21:49:08    阅读次数:182
String s="abc"及String s=new String("abc")详解
一、相关知识点 1. 栈(stack)与堆(heap)都是Java用来在Ram(随机存取存储器)中存放数据的地方,栈数据可以共享。 2. 栈的优势是,存取速度比堆要快,仅次于直接位于CPU中的寄存器。缺点是,存在栈中的数据大小与生存期必须是确定的,缺乏灵活性。 堆的优势是可以动态地分...
分类:其他好文   时间:2015-01-27 21:38:34    阅读次数:253
结构体的序列和还原
// 定义结构体type TmyRec= record name:string[10]; password:string[10]; end;function RawToBytes(const AValue; const ASize: Integer): TBytes;begin S...
分类:其他好文   时间:2015-01-27 21:30:58    阅读次数:156
leetcode_3_Longest Substring Without Repeating Characters
描述: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is ...
分类:其他好文   时间:2015-01-27 20:21:40    阅读次数:149
leetcode_5_Longest Palindromic Substring
描述: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 思路: 刚开始非常天...
分类:其他好文   时间:2015-01-27 20:21:30    阅读次数:205
Java文件读写详解。 附txt乱码问题, html乱码问题
先看代码 1 public class FileReader { 2 public static String readFile(String fileName) { 3 String fileContent = ""; 4 try { 5 ...
分类:编程语言   时间:2015-01-27 20:18:40    阅读次数:154
Leetcode#12 Integer to Roman
原题地址找规律+模拟,真没啥可说的。代码: 1 string intToRoman(int num) { 2 string res; 3 4 while (num >= 1000) { 5 res += "M"; 6 ...
分类:其他好文   时间:2015-01-27 20:16:36    阅读次数:170
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!