码迷,mamicode.com
首页 >  
搜索关键字:println    ( 5792个结果
逻辑判断
classTestLogic { publicstaticvoidmain(String[]args) { booleana=true; booleanb=false; System.out.println(a&b); System.out.println(a&&b); System.out.println(a|b); System.out.println(a||b); System.out.println(!a&b); System.out.println(a^b); in..
分类:其他好文   时间:2015-01-07 07:07:10    阅读次数:162
【java解惑】关于异常捕获的三条要求
有如下所示代码:publicclassExample037{ staticvoidoutput1(){ try{ System.out.println("如果一个catch子句要捕获一个类型为E的被检查异常," +"而其相对应的try子句不能抛出E的某种子类型的异常,那么这就是一个编译期错误"); }catch(IOExceptione){ Syste..
分类:编程语言   时间:2015-01-07 07:04:21    阅读次数:258
控制流 control flow
1 Switch控制语句1.1 Switch语句中Turple的使用let somePoint = (1, 1)switch somePoint {case (0, 0): println("(0, 0) is at the origin")case (_, 0)://使用下划线(unders...
分类:其他好文   时间:2015-01-06 19:33:06    阅读次数:181
Java获取当前路径和读取文件
Java获取当前路径和读取文件 1、利用System.getProperty()函数获取当前路径: System.out.println(System.getProperty("user.dir"));//user.dir指定了当前的路径 2、使用File提供的函数获取当前路径: File directory = new File("");//设定为当前文件夹 System.ou...
分类:编程语言   时间:2015-01-06 11:58:44    阅读次数:422
String对象的经典问题
1、==比较两个对象的地址2、equals比较两个对象的值3、intern方法返回池中已有的对象,如果池中没有,则加入池中Stringstr="abc";Stringstr1="abc";Stringstr2=newString("abc");System.out.println(str==str1);//trueSystem.out.println(str1=="abc");//trueSystem.out.printl..
分类:其他好文   时间:2015-01-06 07:26:43    阅读次数:142
quartz 定时
spring3不支持quartz2 1.业务调度的类(就是你想要做的事情的逻辑部门) public?class?QuartzTest?{ public?void??quartzTest(){ System.out.println("I?Love?You,?zhuzhu"); } } 2.写一个job p...
分类:其他好文   时间:2015-01-05 23:31:31    阅读次数:301
进制转换处理方法
class?HexadecimalConversion{ public?static?void?main(String[]?args)?{ toBin(6); System.out.println("\n"); System.out.println("------------------------\n"); toHex(-60); System.out....
分类:其他好文   时间:2015-01-04 19:48:44    阅读次数:151
httpClient发送https 请求
做项目要用到httpClient发送https到服务器,要求URL中带参数,并且发送xml格式的报文,第一次做,在这里记录一下,以便以后查询的帮助别人:本文在证书配置正确的前提下执行客户端代码;publicstaticvoidhttpsRequest()throwsException{ System.out.println("thisishttps"); Ke..
分类:Web程序   时间:2015-01-04 19:47:40    阅读次数:250
Java随笔:混合类型表达式类型转换问题
混合表达式处理“坑”很多,看看下面这段代码:short x = 0;int y = 123456;x += y;System.out.println(x);按照正常的理解 x+=y 等价于 x = x+y这里将int型的 y 强转为short型 x,会报告错误:错误: 不兼容的类型: 从int转换到...
分类:编程语言   时间:2015-01-03 22:20:51    阅读次数:231
【java解惑】移位运算符规则
如下代码:publicclassExample027{ publicstaticvoidmain(String[]args){ inti=0; while(-1<<32!=0){ i++; } System.out.println(i); } }结果说明:将上述程序放到eclipse中,在输出行会有提示“Unreachablecode”。也就是while循环是死循环无法退出。结果..
分类:编程语言   时间:2015-01-03 21:10:22    阅读次数:208
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!