摘要: Math.random()简介Math.random():产生一个[0,1)之间的随机数。返回指定范围的随机数(m-n之间)的公式:Math.random()*(n-m)+m;示例 1.简单for循环10次输出值 源码: for(int i=0;i<10;i++) { System.out.println("验证码:"+Math.random()); } 2.生成5个范围为[A,z](大小写)的随机验证码 思想:根据ASC2码可以知道在65-122为大小写顺序,但是中间有一些符号。于是用判断把这些符... 阅读全文
posted @ 2013-07-07 21:59 Yanggan 阅读(709) 评论(0) 推荐(0) 编辑
摘要: 你有没有遇到过那个经典的面试问题,“你预见过自己5年后的职位吗?”。每当有人这样问时,我就会想到Twisted Sister乐队从1984年开始发行的某张专辑。当然是玩摇滚,至不济也得是个摇滚明星级别的程序员吧。这种问题通常得不到正面回答——就像那种在面试中无病呻吟式的陈词滥调,”你最大的缺点是什么?”。有的时候是不是太大起大落?以至于那些无辜的旁观者会受到伤害。但是,我认为这是一种不一样并更严肃的话题,它应该引起足够的重视。而这并不是为了面试官好,而是为你好。文章开始的那个问题听起来有点老生常谈,而且大部分人都是有备而来。但是这个问题却会引起更深层的思考:一名软件开发人员的职业生涯会是怎样的 阅读全文
posted @ 2013-07-07 16:29 Yanggan 阅读(339) 评论(0) 推荐(0) 编辑
摘要: Code Complete(2nd edition) by Steve McConnellThe Pragmatic ProgrammerStructure and Interpretation of Computer ProgramsThe C Programming Languageby Kernighan and RitchieIntroduction to Algorithmsby Cormen, Leiserson, Rivest & SteinDesign Patternsby the Gang of FourRefactoring: Improving the Desig 阅读全文
posted @ 2013-07-07 15:58 Yanggan 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 编译错误区error: cannot find symbol2.原因:再使用时候可能拼写错误,大小写没有书写正确引起的2.示例:FloatTest.java:16: error: cannot find symbolSystem.out.println(a/a==Float.NAN); ^ symbol: variable NAN \\ 正确为NaN,所以显示为找到元素 location: class Float1 error运行异常&错误区Main method not found in class原因:没有写main函数或者main函数书写错误(大小写不对,缺写... 阅读全文
posted @ 2013-07-07 12:59 Yanggan 阅读(435) 评论(0) 推荐(0) 编辑
摘要: 数据类型和运算符篇从源码中提取文档注释package yanggan;/***Description:*网站:百度搜索*Copyrigth (c),2001-2013,Gan.Yang*This program is protected by copyrigth laws.*Program Name:*Data:*@author Gan.Yang incyanggan@gmail.com*@version 1.0*/public class JavadocTest//学习文档注释{ /** *简单测试Field */ protected String name; /** *main方法,程序. 阅读全文
posted @ 2013-07-07 00:02 Yanggan 阅读(395) 评论(0) 推荐(0) 编辑