![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
shilianjun
这个作者很懒,什么都没留下…
展开
-
JAVA 中除法后小数精度问题
JAVA 中除法后小数精度问题 import java.text.DecimalFormat; DecimalFormat df = new DecimalFormat("###.000"); df.format((double)100/3); //33.333原创 2010-06-17 13:08:53 · 628 阅读 · 0 评论 -
java notebook
1.日期格式化 SimpleDateFormat sfd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); G 公元 文本 y 年份 数字 M 月 ...原创 2010-06-19 21:27:55 · 88 阅读 · 0 评论 -
关于java中遍历map、dom4j解析xml文件、加载properties文件
1. Map遍历 方法一: for (Object o : testMap.keySet()) { System.out.println("key=" + o + " value=" + testMap.get(o)); } 方法二: Map map = new HashMap(); Iterator it = map.entrySet...原创 2010-09-09 20:14:24 · 82 阅读 · 0 评论 -
java 解析 生成 json
1. String receiveStr = "{'opType':'add','infostr':[{'infoId':'123456'},{'infoId':'000000'}]}"; JSONObject jsonObject = new JSONObject(recevieStr); opType = jsonObject.getString("opType"); JSONArra...原创 2010-09-16 16:49:09 · 110 阅读 · 0 评论 -
ssh jar 介绍
Hibernate hibernate3.jar,这个是hibernate3.0的核心jar包,必须的,呵呵,没的选,像我们常用的Session,Query,Transaction都位于这个jar文件中,必要。 cglib-2.1.3.jar,CGLIB库,Hibernate用它来实现PO字节码的动态生成,非常核心的库,必要。 asm.jar ASM字节码库 如果使用...原创 2011-01-03 14:19:33 · 89 阅读 · 0 评论 -
java序列化Serializable
(一)序列化作用: 把内存中的对象转化为另一种形式,以供传输或存储。 (二)序列化前提: (1)要序列化对象必须是可序列化的,即必须实现 Serializable 接口。 (2)要序列化对象的属性也都是可序列化的。 (3)要序列化对象引用的对象也必须是可序列化的,如:要序列化一个 HashMap 实例,需要把放入到HashMap中的对象也都序列化。 (4)要序列...原创 2011-08-17 23:22:01 · 86 阅读 · 0 评论 -
ssh 系统启动时加载
web.xml: org.springframework.web.context.ContextLoaderListener com.book.util.SysInit struts2 org.apache.struts2.dispatcher.FilterDispatcher ...原创 2010-10-19 23:01:09 · 168 阅读 · 0 评论 -
java范围内的随机数
int max = 45; int min = 30; Random random = new Random(); int result = random.nextInt(max) % (max - min + 1) + min;原创 2012-07-12 17:01:54 · 93 阅读 · 0 评论 -
java 解析 url
public static Map getParamsMap(String URL) { Map mapRequest = new HashMap(); try { String[] arrSplit = null; String strUrlParam = TruncateUrlPage(URL); if (strUrlParam == null) { ...原创 2013-06-20 17:33:26 · 130 阅读 · 0 评论