1.介面(interface),介面被用來建立類與類之間關聯的標準。 Javacode public interface ITest{ public void test(); } public class TestImpl implements ITest{ public void test(){ System.out.println("test"); } }
import java.math.BigDecimal;import java.text.DecimalFormat;import java.text.NumberFormat;public class format { double f = 111231.5585; public void m1() { BigDecimal bg = new BigDecimal(f); double f1 = bg.setScale(2,
JFileChooser類的使用非常簡單,主要是對一些屬性的設定,以及檔案篩選器的使用。import javax.swing.JFileChooser;public class FileChooser {public static void main(String[] args){JFileChooser fc = new
用tomcat6做web伺服器,一直用著挺好的突然一次啟動tomcat就發生以下異常:嚴重: IOException while loading persisted sessions: java.io.EOFExceptionjava.io.EOFException at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2279) at
The java programing language provides three kinds of throwables: checked exception, run-time exceptions and errors.Checked exceptions generally indicate recoverable conditions.There are two kinds of unchecked throwables: run-time exceptions and
Data TypeDefault Value (for fields)byte0short0int0long0Lfloat0.0fdouble0.0dchar'\u0000'String (or any object) nullbooleanfalse Comment : Local variables are slightly different; the compiler never assigns a default value to an uninitialized local