共 91 篇文章
显示摘要每页显示  条
JSP 中EL表达式用法详解。<param-name>userid</param-name>表达式语言支持的算术运算符和逻辑运算符非常多,所有在Java语言里支持的算术运算符,表达式语言都可以使用;上面页面中示范了表达式语言所支持的加、减、乘、除、求余等算术运算符的功能,读者可能也发现了表达式语言还支持div、mod等运算符。${ ${param.password1 } = =...
Java String.split()用法小结。1、如果用“.”作为分隔的话,必须是如下写法,String.split("\\."),这样才能正确的分隔开,不能用String.split(".");2、如果用“|”作为分隔的话,必须是如下写法,String.split("\\|"),这样才能正确的分隔开,不能用String.split("|");public String[] split(String regex)S...
public class TestRandom { public static void main(String[] args) { // 案例1 System.out.println("Math.random()=" + Math.random());// 结果是个double类型的值,区间为[0.0,1.0) int num = (int) (Math.random() * 3); // 注意不要写成(int)Math.random()*3,这个结果为0,因为先执行了强制转换 System.out.println("num...
UUID;public class UTest { public static void main(String[] args) { UUID uuid = UUID.randomUUID();JDK1.5 如果使用的JDK1.5的话,那么生成UUID变成了一件简单的事,以为JDK实现了UUID: java.util.UUID,直接调用即可. UUID uuid = UUID.randomUUID(); String s = UUID.randomUUID().toString();//用来生成数据库的主键id非常不错...
final、finally和finalize的区别是什么?final的类的所有方法都不能被重写,但这并不表示final的类的属性(变量)值也是不可改变的,要想做到final类的属性值不可改变,必须给它增加final修饰,请看下面的例子:Java代码public final class FinalTest {int i = 10;public static void main(String[] args) {FinalTest ft = new FinalTest();ft....
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name&g...
// 定义HashTable,用来测试 Hashtable<String,String> tab = new Hashtable<String,String>(); tab.put("a", "aaa"); tab.put("b", "bbb"); tab.put("c", "ccc"); tab.put("d", "ddd"); Iterator<String>iterator_1 = tab.keySet()....
Scanner 中关于 nextInt()与nextLine()的问题 nextInt() 接收一个整型字符,nextline()读入一行文本,会读入"\n"字符,但"\n"并不会成为返回的字符串值的一部分.加入如下代码int n = ScannerObjext.nextInt()String s1 = ScannerObjext.nextLine();String s2 = ScannerObjext.nextLine();假设输入:42.and don...
Eclipse中自动添加注释(作者,时间)方法一:Eclipse中设置在创建新类时自动生成注释。windows-->preferenceJava-->Code Style-->Code Templatescode-->new Java files编辑它。进入编辑模式后就可以自定义注释了。以上是文件注释,类中的方法自动添加注释类似,对应于Files下面的Types。Eclipse快捷键:选中你的方法后alt+shift+...
帮助 | 留言交流 | 联系我们 | 服务条款 | 下载网文摘手 | 下载手机客户端
北京六智信息技术股份有限公司 Copyright© 2005-2024 360doc.com , All Rights Reserved
京ICP证090625号 京ICP备05038915号 京网文[2016]6433-853号 京公网安备11010502030377号
返回
顶部