![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
秒秒幸福
这个作者很懒,什么都没留下…
展开
-
正则表达式
表1.常用的元字符代码说明.匹配除换行符以外的任意字符\w匹配字母或数字或下划线或汉字\s匹配任意的空白符\d匹配数字\b匹配单词的开始或结束^匹配字符串的开始$匹配字符串的结束一个网站如果要求你填写的QQ号必须为5位到12位数字时,可以使用:转载 2015-03-17 12:38:35 · 535 阅读 · 0 评论 -
java读取.properties文件及文件复制(通道)
1、使用java.util.Properties类的load()方法 示例: Java代码 InputStream in = new BufferedInputStream(new FileInputStream(name)); Properties p = new Properties(); p.load(in); in.close() // 任何原创 2015-03-17 12:00:22 · 830 阅读 · 0 评论 -
利用HTTPClient模块中HttpGet和HttpPost 发送接口请求
HttpClient常用HttpGet和HttpPost这两个类,分别对应Get方式和Post方式。 无论是使用HttpGet,还是使用HttpPost,都必须通过如下3步来访问HTTP资源。 1.创建HttpGet或HttpPost对象,将要请求的URL通过构造方法传入HttpGet或HttpPost对象。 2.使用Defa原创 2015-03-21 15:00:50 · 931 阅读 · 0 评论 -
获取系统内存空间和物理内存空间
// 手动调用GCSystem.gc() ; //free和use和total均为KB long free=0; long use=0; long total=0; int kb=1024; Runtime rt=Runtime.getRuntime(); total=rt.totalMemory(转载 2015-03-12 16:49:45 · 2801 阅读 · 0 评论 -
java 反射setAccessible()方法的使用
首先看下面的代码:public class A{ private int data=0;}public class B{ public static void main(String[] args) { A a1 = new A(); //获得A类中所有定义的属性 Field[]原创 2015-05-20 12:12:07 · 16701 阅读 · 2 评论 -
Java Servlet PDF文件生成
public class PdfServlet extends HttpServlet {public CertServlet() { } public void init(ServletConfig config) throws ServletException { } public void doGet(HttpServle原创 2015-05-22 15:19:39 · 1274 阅读 · 0 评论