內部類,inner class,是定義在另一個類中的類。內部類是一種編譯器現象,與虛擬機器無關,編譯器將會把內部類翻譯成用$分隔外部類名與內部類名的常規類檔案,而虛擬機器對此一無所知。內部類比常規類更加強大,最大的特點是內部類可以訪問外圍類的私人資料。非內部類的修飾符 only public, abstract & final are
static為靜態意思,常用來修飾內部類,方法,變數。靜態域static修飾的變數在每個類中只有一個副本,即這個類的所有對象共用一個變數,它屬於類,不屬於任何獨立的對象。package com.xujin;class Base{protected static int MAX = 100;}public class Another extends Base{public static void main(String[] args){Base base1 = new Base();Base
在各種程式設計語言中方法的參數有兩種,分別是:值調用,引用調用。Java程式設計語言總是採用值調用,即方法得到了所有參數值的一個拷貝。細分的話,方法參數一共兩種類型:如果參數是基礎資料型別 (Elementary Data Type),那麼傳遞的是一個基礎資料型別 (Elementary Data Type)的值;如果參數是對象,那麼傳遞的是一個對象引用的拷貝,注意不是C++中的對象引用。這個引用的拷貝和其他的拷貝一樣,同時引用了一個對象。一個方法不可能修改一個基礎資料型別
Jstack is a built-in tool of JVM which is used to analyze the performance of java program.It prints the stack information of a process to the standard output of your system.Of cause you can redirect the output of the jstack to a file for later
原文連結:http://www.javaeye.com/topic/2665851、圖片格式 JAVA的API很好,com.sun.image.codec.jpeg.JPEGCodec和com.sun.image.codec.jpeg.JPEGImageEncoder 這兩個類基本上自動解決了類型轉換的問題,可以正常實現bmp轉jpg、png轉jpg、gif轉jpg,但是暫時還沒有解決gif轉gif的功能。 2、畫面品質的問題 BufferedImage tag = new
4 設有各不相同面值的人民幣若干,編寫一個電腦程式,對任意輸入的一個金額,給出能夠組合出這個值得最佳可能,要求使用幣值的個數最少。import java.util.*;public class Test5 {public static void main (String[] args) {//10, 5, 2, 1;System.out.println("Input money:");Scanner in = new Scanner(System.in); int m =