Java中的转义字符
\n 换行(\u000a)
\t 水平制表符(\u0009)
\b 空格(\u0008)
\r 回车(\u000d)
\f 换页(\u000c)
\' 单引号(\u0027)
\" 双引号(\u0022)
\\ 反斜杠(\u005c)
\ddd 三位八进制
\udddd 四位十六进制
相关文档:
今晚在逛CSDN的时候发现了,有人用java写了生成myeclipse注册码的代码,所以就抄录了下来。 o(∩_∩)o 哈哈
package gggg;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class MyEclipseGen {
private static final ......
1.读取XML文件的类:
public class XMLUtils {
private final String DB_XML_FILE = "/XMLSetting.xml";
public Properties getPropertiesfromXML() {
URL url = XMLUtils.class.getResource(dBXMLFILE);
URI uri;
try {
uri = url.toURI();
InputSource xmlfile = new InputSource(uri.g ......
Runtime runtime = Runtime.getRuntime();// 开始调用服务端脚本
Process process = runtime.exec("encode.sh /home/tomcat6/kgedata/note_not_encode/ /home/tomcat6/kgedata/note_encode/");
int exitVal = process.waitFor();
System.out.prin ......
import java.text.DecimalFormat
double a = 2.3659874;
//小数格式化,引号中的0.000表示保留小数点后三位(第四位四舍五入)
DecimalFormat df = new DecimalFormat("0.000");
String num = df.format(a);
System.out.println(num);
输出结果就是 2.366
Java计算时间差
比如:现在是2004-03-26 13:31:40
&nbs ......