![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
文章平均质量分 79
leading_the_way
这个作者很懒,什么都没留下…
展开
-
java获取工程目录下文件
static{ String root = Constants.class.getResource("/").getFile(); try { root = new File(root).getCanonicalPath(); root += File.separator; } catch (IOException e) { throw new RuntimeException(e);转载 2014-10-14 20:54:08 · 225 阅读 · 0 评论 -
获取指定目录下的文件
String projectPath = Constants.class.getResource("/").getFile(); int findindex = projectPath.indexOf("WEB-INF"); projectPath = projectPath.substring(1, findindex + 8)+"workflow/"+workflowpath; Fi原创 2014-10-14 20:58:24 · 210 阅读 · 0 评论 -
java中随机函数的使用及简单应用
Java中存在着两种Random函数: 一、java.lang.Math.Random; 调用这个Math.Random()函数能够返回带正号的double值,该值大于等于0.0且小于1.0,即取值范围是[0.0,1.0)的左闭右开区间,返回值是一个伪随机选择的数,在该范围内(近似)均匀分布。 观察会发现代码的用一个循环10次循环输出num的取值,均随机分布在[0,3)之间!在使原创 2014-11-02 21:27:51 · 1186 阅读 · 0 评论