/* * To change this template, choose Tools | Templates * and open the template in the editor. */import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import
Java新手經常碰到的問題,網上的解決方案很多。個人認為比較簡單實用的兩種方式:1)將字串parse成日期類型,再將其format成字串類型,和原有字串比較即可。比較嚴格,類似2008-8-8都不符合要求!Code highlighting produced by Actipro CodeHighlighter
安裝Openbravo時遇到Java Heap錯誤:C:\development\Openbravo-3.0MP22.2\build.xml:702: The following error occurred while executing this line:C:\development\Openbravo-3.0MP22.2\build.xml:611: The following error occurred while executing this
泛型是什麼意思在這就不多說了,而Java中泛型類的定義也比較簡單,例如:public class Test<T>{}。這樣就定義了一個泛型類Test,在執行個體化該類時,必須指明泛型T的具體類型,例如:Test<Object> t = new Test<Object>();,指明泛型T的類型為Object。 但是Java中的泛型方法就比較複雜了。
今天部署項目過程中tomcat報如下異常:java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) at
1.安裝:SQL Server 2000 Driver for JDBC Service Pack 3 下載安裝JDBC SP3 http://www.microsoft.com/downloads/details.aspx?familyid=07287B11-0502-461A-B138-2AA54BFDC03A&displaylang=en裡面的SetUp.exe 按照提示安裝可以了.成功後有三個檔案要使用:c:\program files\Microsoft SQL Server
程式中經常會使用到一些常數,如果這些常數是共用的,在java中可以定義一個類或介面來統一管理常數。其他對象從這些類或介面取用常數。如果需要修改常數則可以從這些類或介面上直接修改,而不用更改程式的其他部分。 使用介面儲存常數:public interface Usual {public static final int TURN_LEFT=1;public static final int TURN_RIGHT=2;public static final int SHOT=3;}
在開發中,我們經常把密碼資訊進行加密,在網上可以找到很多MD5加密的方法,在這裡使用的是JavaSE內建的類。 1: import java.security.MessageDigest; 2: import java.security.NoSuchAlgorithmException; 3: import sun.misc.BASE64Encoder; 4: 5: 6: public class Test { 7: 8: public