易截截图软件、单文件、免安装、纯绿色、仅160KB

JAVA常用操作语句 项目中的总结四


 eclipse选一个变量后,这个类里的该变量不变色问题解决:
alt + shift + o

/**
* 写入日志
* filePath 日志文件的路径
* code 要写入日志文件的内容

*/

public

static

boolean
print(String filePath,String code) {

try
{
File tofile
=
new
File(filePath);
FileWriter fw
=
new
FileWriter(tofile,
true
);
BufferedWriter bw
=
new
BufferedWriter(fw);
PrintWriter pw
=
new
PrintWriter(bw);

System.out.println(getDate()
+
"
:
"
+
code);
pw.println(getDate()
+
"
:
"
+
code);
pw.close();
bw.close();
fw.close();

return

true
;
}
catch
(IOException e) {

return

false
;
}
}

/**
* 判断是不是合法手机
* handset 手机号码

*/

public

static

boolean
isHandset(String handset) {

try
{

if
(
!
handset.substring(
0
,
1
).equals(
"
1
"
)) {

return

false
;
}

if
(handset
==
null

||
handset.length()
!=
11
) {

return

false
;
}
String check
=

"
^[0123456789]+$
"
;
Pattern regex
=
Pattern.compile(check);
Matcher matcher
=
regex.matcher(handset);

boolean
isMatched
=
matcher.matches();

if
(isMatched) {

return

true
;
}
else
{

return

false
;
}
}
catch
(RuntimeException e) {

return

false
;
}
}
ISBN(国际标准书号)的校验
Java code
public

class
Test {

public

static

void
main(String[] args) {
System.out.println(
"
9787302155638
"

+
ISBN.checkISBN(
"
9787302155638
"
));
System.out.println(
"
7564105607
"

+
ISBN.checkISBN(
"
7564105607
"
));
System.out.println(
"
730213880X
"

+
ISBN.checkISBN(
"
730213880X
"
));
System.out.println(
"
7302138800
"

+
ISBN.checkISBN(
"
7302138800
"
));
System.out.println(
"
9790000000000
"

+
ISBN.checkIS


相关文档:

关于java打包

一个简单的双击就能运行jar文件的打包过程:
http://blog.csdn.net/ihc523/archive/2009/10/11/4636832.aspx
eclipse导出jar文件再将它转换成exe可执行文件:
http://hi.baidu.com/%C4%CF%BA%BD%CC%EC%CF%C2/blog/item/1601a381ac9af9d1bd3e1e3d.html
打Jar包的一个Eclipse插件FatJar:
http://blog.csdn.net/lqsmn613/ar ......

java多线程学习

关于 Java Concurrency
 
   自从Java诞生之时,Java 就支持并行的概念,比如线程和锁机制。这个教程帮助开发多线程Java程序员能够理解核心的Java并行理念以及如何使用他们。 内容涉及到Java语言中的线程, 重练级以及轻量级同步机制 以及JavaSE 5 中的锁,原子量 并行容器,线程调度 以及线程执行者 ......

JAVA最短路径代码

import java.util.LinkedList;
import java.util.List;
public class ShortestPaths {
     private static String showPath[] = { "", "", "", "", "", "" }; 
      
     & ......

JAVA常用操作语句 项目中的总结三


获得mysql和oracle链接的类
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnectDB {
private static final String MYSQL = "jdbc:mysql://";
private static final String ORACLE = "jdbc:oracle:thin:@";
private ConnectD ......

[Java Generics] get T.Class from T

 
/**
 * Copyright (c) 2010 IBOBO Corporation. All Rights Reserved.
 */
package com.ibm.util.dao.hib;
/**
 * [Java Generics] get T.Class from <T>
 * 
 * @author <a ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号