標籤:jsp簡單練習-封裝類綜合應用執行個體
<%@ page contentType="text/html; charset=gb2312" %><!-- JSP指令標籤 --><%@ page import="java.util.*" %> <!-- JSP指令標籤 --><html> <!-- html標記符 --><body> <% // 以下為java程式片 boolean booleanTemp=true; Boolean BooleanTemp=new Boolean(false); byte byteTemp=80; Byte ByteTemp=new Byte(byteTemp); char charTemp='c'; Character CharacterTemp=new Character(charTemp); int intTemp=234; Integer IntegerTemp=new Integer(intTemp); short shortTemp=235; Short ShortTemp=new Short(shortTemp); long longTemp=1234567; Long LongTemp=new Long(longTemp); float floatTemp=1.234F; Float FloatTemp=new Float(floatTemp); double doubleTemp=1.23E-8; Double DoubleTemp=new Double(doubleTemp); out.println("布爾型封裝對象BooleanTemp值為:"+BooleanTemp.booleanValue()+"<br>"); out.println("字元型封裝對象CharacterTemp值為:"+CharacterTemp.charValue()+"<br>"); out.println("整型封裝對象IntegerTemp值為:"+IntegerTemp.intValue()+"<br>"); out.println("短整型封裝對象ShortTemp值為:"+ShortTemp.shortValue()+"<br>"); out.println("位元組型封裝對象ByteTemp值為:"+ByteTemp.byteValue()+"<br>"); out.println("長整型封裝對象LongTemp值為:"+LongTemp.longValue()+"<br>"); out.println("單精確度封裝對象FloatTemp值為:"+FloatTemp.floatValue()+"<br>"); out.println("雙精確度型封裝對象doubleTemp值為:"+doubleTemp+"<br>"); %></body> <!-- html標記符 --></html>