來自:http://developer.51cto.com/art/200905/124291.htm本文將為大家介紹20人員非常有用的Java功能代碼。這20段代碼,可以成為大家在今後的開發過程中,Java編程手冊的重要部分。1. 把Strings轉換成int和把int轉換成StringString a = String.valueOf(2); //integer to numeric string int i = Integer.parseInt(a); //numeric
對於i++一直畏之如狼虎,因為它蛋疼的副作用 一直不敢面對,今天仔細瞭解了一下,機制應該如下。運行到i++時,執行的順序如下:1~ i 被推出,被使用者得到。2~ i 執行 ++ 的部分。3~ 使用者開始使用推出的 i 值。而這三步順序同樣解釋了為什麼i = i++;這樣的語句得到的 i 值不變。同理 ++i 的執行順序如下:1~ i 執行 ++ 的部分。2~ i 被推出,被使用者得到。3~ 使用者開始使用推出的 i 值。2012 - 09以上是一年前的文章了,往後是今年評論的。int i =
Here is a good and simple anti cross-site scripting (XSS) filter written for Java web applications. What it basically does is remove all suspicious strings from request parameters before returning them to the application. It’s an improvement over my
/* * %W% %E% * * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package java.lang;/** * The Boolean class wraps a value of the primitive type *
在Linux下Jdk的安裝和Java環境變數的設定1、到www.sun.com下載最新版本的j2sdk for linux2、安裝jdk1.4.2 for linux,以下是在Redhat Linux 9下為例: 以root身份登入 (1)開啟一個終端 (2)輸入命令ls -l 查看安裝檔案的許可權 (3)輸入命令chmod a+x j2sdk-1_4_2_01-linux-i586-rpm.bin,給所有的使用者添加執行的許可權。