![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
Sky牟天
追求结构性良好的软件攻城狮
展开
-
获取系统时间字符串 java
DateFormat.getDateTimeInstance().format(new Date()); 需要: import java.text.DateFormat; import java.util.Date; Example: import java.text.原创 2011-08-12 12:35:02 · 871 阅读 · 0 评论 -
获取本机IP java
内部: InetAddress.getLocalHost().getHostAddress()原创 2011-08-12 13:41:36 · 282 阅读 · 0 评论 -
获取本机所有IP java
有时候 InetAddress.getLocalHost().getHostAddress()会因为本机网络环境发生变化出问题,用下面方法可以获得本机所有IP。 EXample: import java.net.InetAddress; import jav原创 2011-08-12 13:56:31 · 357 阅读 · 0 评论 -
How to Use Swing Timers
如果要实现动画效果,就要用到Timer How to Use Swing Timers A Swing timer (an instance of javax.swing.Timer) fires one or more action events aft转载 2011-10-02 12:07:09 · 665 阅读 · 0 评论 -
Java Constructor sequence discuss | Java构造函数顺序小记
Class的构造顺序可以从编译的角度去理解,突然想到一个非常好的例子来说明这个问题 package com.cachetian.scjp; public class MyChildObj { public MyChildObj() { System.out.println("My Child Obj Constructes"); } } package com.cachetian原创 2012-02-09 21:40:14 · 941 阅读 · 0 评论 -
switch用法 | 再学习switch用法
switch的语句一般形式如下: switch (x){ case a://ok case b://compiler errorswitch (expression) { case constant1: code block case constant2: code block default: code block0 } switch的表达式结果原创 2012-04-11 23:01:58 · 1985 阅读 · 0 评论 -
迭代最快的Collection
ArraylList是可重复集合迭代最快的,LinkedHashSet是不可重复集合迭代最快的。原创 2012-04-12 23:52:08 · 861 阅读 · 0 评论 -
IllegalAccessError引发的思考
今天莫名其妙的遇到了这个错误,原因是我把jar包放在了不同的位置,导致了修饰符范围发生改变,然后就访问不到原有的方法和属性了。 api中原文是这样的 Thrown if an application attempts to access or modify a field, or to call a method that it does not have access to. Norm原创 2012-04-20 01:03:03 · 8635 阅读 · 0 评论 -
Struts2分页例子
博客源地址:http://cachetianinjava.diandian.com/post/2012-06-15/40027736663(这个博客也是我的) 为什么写这个? 1.由于项目需要,今天用struts2实现了分页,感觉效果不错,有这个能力。 2.自己在网上查过相关资料,都比较陈旧,没有满意的效果。 故特花时间整理了一下,专门写了一个示例工程,分享给大家~ (又当好人了,谁原创 2012-06-15 08:44:26 · 1499 阅读 · 1 评论