Java中的转义字符
\n 换行(\u000a)
\t 水平制表符(\u0009)
\b 空格(\u0008)
\r 回车(\u000d)
\f 换页(\u000c)
\' 单引号(\u0027)
\" 双引号(\u0022)
\\ 反斜杠(\u005c)
\ddd 三位八进制
\udddd 四位十六进制
相关文档:
在JAVA中, 在使用String.split方法分隔字符串时,但要注意有些字符不能直接用的,分隔符如果用到一些特殊字符,比如 "| "
,"*",等否则会出现问题,以前刚用时就因为这个问题而看了半天的代码。
public String[] split(String regex)
Splits this string around matches of the given regular expression.
&nbs ......
/**
* 交换排序-冒泡排序,核心思想 以大小为依据交换
*
* */
public void bubbleSort(double[] a){
//将要进行比较的数大的尽量往后排,每次循环把最大的排在要排序数组的末位。
boolean hasSwap = true;
for(int i = 1; i < a.length&& hasSwap; i ++){//循环的次数
hasSwap = ......
import java.net.*;
import java.io.*;
public class PortScanner {
public static void main(String args[]){
String host="localhost";
new PortScanner().scan(host);
}
public void scan(String host){
  ......
Java文件下载的几种方式
< type="text/javascript">
document.body.oncopy = function() {
if (window.clipboardData) {
setTimeout(function() {
var text = cli ......
1列出磁盘/文件夹内的文件
import java.io.File;
import java.io.IOException;
public class Test {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
&n ......