04 2015 档案
摘要:一、概述 正则表达式是一串描述一个字符序列的字符,可以用来查找其他字符序列中的匹配项。支持正则表达式处理的是两个类:Pattern和Matcher,使用Pattern定义正则表达式,使用Matcher匹配其他序列中的模式。二、创建正则表达式 创建正则表达式就是创建一个特殊的字符串。 正则表达式...
阅读全文
摘要:一、概述 Java的IO支持通过java.io包下的类和接口来完成,在java.io包下主要有包括输入、输出两种IO流,每种输入输出流又可分为字节流和字符流两大类。从JDK1.4以后,Java在java.nio包下提供了系列的全新API,通过java.nio,程序可以更高效的进行输入、输出操作。二...
阅读全文
摘要:一、概述Java是以String类型的对象来实现字符串。String是一个类,当创建一个String对象后,所创建的字符串是不能改变的。在需要使用可修改的字符串时,Java提供两个选择—StringBuffer和StringBuilder。注:声明为String引用的变量在任何时候都可以改变,以指向...
阅读全文
摘要:1、多线程概述当一个程序运行时,内部可能包含了多个顺序执行流,每个顺序执行流就是一个线程。主要以下几个优点:线程之间很容易实现共享内存创建线程代价较小Java语言内置多线程功能支持2、线程的创建和启动所有的线程对象都是Thread类或其子类的对象,每一个线程完成一定的任务。Java定义了两种创建线程...
阅读全文
摘要:题目:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in...
阅读全文
摘要:题目:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't ...
阅读全文
摘要:题目:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space fo...
阅读全文
摘要:题目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your al...
阅读全文
摘要:题目:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 1 str...
阅读全文