- 軟件大小:42.48M
- 軟件語言:中(zhōng)文
- 軟件類型:國(guó)產軟件
- 軟件(jiàn)類別:免費軟件 / 編程工具
- 更新時間:2015-03-17 09:37
- 運行環境:WinAll, WinXP
- 軟件等級:
- 軟件廠商:
- 官方網站:http://www.ynaad.com
![頂一個](/skins/gr/images/c_goodbg.png)
![踩一(yī)個](/skins/gr/images/c_badbg.png)
14.16M/中文/9.3
160.00M/中文/8.5
154.00M/中文/8.2
136.05M/中文/0.8
69.16M/多國語言[中文]/5.0
jdk1.5.0是一款(kuǎn)JAVA最原始的軟件開發(fā)工具包,Java JDK是JAVA運(yùn)行的(de)核心,一些開發的應用都(dōu)需要安裝Java JDK環境(jìng)的應用軟件。趕快下載吧!!!
自動實(shí)現裝箱和解箱操作(Boxing/Unboxing Conversions)
說明(míng):實現了基本類(lèi)型與(yǔ)外覆類之間的隱(yǐn)式轉換。基本類型至外覆類的轉換稱(chēng)為裝箱,外覆類至基本類型(xíng)的轉換為解箱。這些類包括
Primitive Type Reference Type
boolean Boolean
byte Byte
char Character
short Short
int Integer
long Long
float Float
double Double
例如,舊的實現方式
Integer intObject;
int intPrimitive;
ArrayList arrayList = new ArrayList();
intPrimitive = 11;
intObject = new Integer(intPrimitive);
arrayList.put(intObject); // 不(bú)能放入int類型,隻能使Integer
新的實現方式(shì)
int intPrimitive;
ArrayList arrayList = new ArrayList();
intPrimitive = 11;
//在這裏(lǐ)intPrimitive被自動(dòng)的轉換(huàn)為Integer類型(xíng)
arrayList.put(intPrimitive);
5靜態(tài)導入(Static Imports)
很簡單的東西,看一個例子:
沒有靜態導入
Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
有了靜態導入
import static java.lang.Math.*;
sqrt(pow(x, 2) + pow(y, 2));
其中import static java.lang.Math.*;就是靜態導入的語法,它(tā)的意思是導(dǎo)入Math類(lèi)中的所有static方法和屬性(xìng)。這樣(yàng)我們在使用這些方法和屬性(xìng)時就不必寫類名。
需要(yào)注意的是(shì)默認包無法(fǎ)用靜態導入,另外如果導入的類中有重複的方法和屬性則需要寫出類名,否則編譯時無法通過。
6枚舉類(Enumeration Classes)
用法:public enum Name {types, ….}
簡單的(de)例子:
public enum Colors {Red, Yellow, Blue, Orange, Green, Purple, Brown, Black}
public static void main(String[] args){
Colors myColor = Colors.Red;
System.out.println(myColor);
}
又一個(gè)簡單例子:
import java.util.*;
enum OperatingSystems {windows, unix, linux, macintosh}
public class EnumExample1 {
public static void main(String args[]) {
OperatingSystems os;
os = OperatingSystems.windows;
switch(os) {
case windows:
System.out.println(“You chose Windows!”);
break;
case unix:
System.out.println(“You chose Unix!”);
break;
case linux:
System.out.println(“You chose Linux!”);
break;
case macintosh:
System.out.println(“You chose Macintosh!”);
break;
default:
System.out.println(“I don’t know your OS.”);
break;
}
}
}
應(yīng)運enum簡寫的例子:
import java.util.*;
public class EnumTest
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("Enter a size: (SMALL, MEDIUM, LARGE, EXTRA_LARGE) ");
String input = in.next().toUpperCase();
Size size = Enum.valueOf(Size.class, input);
System.out.println("size=" + size);
System.out.println("abbreviation=" + size.getAbbreviation());
if (size == Size.EXTRA_LARGE)
System.out.println("Good job--you paid attention to the _.");
}
}
enum Size
{
SMALL("S"), MEDIUM("M"), LARGE("L"), EXTRA_LARGE("XL");
private Size(String abbreviation) { this.abbreviation = abbreviation; }
public String getAbbreviation() { return abbreviation; }
private String abbreviation;
}
enum類中擁(yōng)有方法的一個例子:
enum ProgramFlags {
showErrors(0x01),
includeFileOutput(0x02),
useAlternateProcessor(0x04);
private int bit;
ProgramFlags(int bitNumber) {
bit = bitNumber;
}
public int getBitNumber() {
return(bit);
}
}
public class EnumBitmapExample {
public static void main(String args[]) {
ProgramFlags flag = ProgramFlags.showErrors;
System.out.println(“Flag selected is: “ +
flag.ordinal() +
“ which is “ +
flag.name());
}
}
7元數(shù)據(Meta data)
請參考
http://www-900.ibm.com/developerWorks/cn/java/j-annotate1/
http://www-900.ibm.com/developerworks/cn/java/j-annotate2.shtml
8Building Strings(StringBuilder類)
在JDK5.0中引入了StringBuilder類,該類的(de)方法不(bú)是(shì)同步(synchronized)的,這使(shǐ)得它比(bǐ)StringBuffer更加輕量級(jí)和有(yǒu)效。
9控製台輸入(Console Input)
在JDK5.0之(zhī)前我們隻能通過JOptionPane.showInputDialog進行輸入,但在5.0中我們可以通過類Scanner在控製台進行輸入操作
例如(rú)在1.4中的輸入
String input = JOptionPane.showInputDialog(prompt);
int n = Integer.parseInt(input);
double x = Double.parseDouble(input);
s = input;
在5.0中我們可以
Scanner in = new Scanner(System.in);
System.out.print(prompt);
int n = in.nextInt();
double x = in.nextDouble();
String s = in.nextLine();
10Covariant Return Types(不曉得怎麽翻譯,大概是 改變返回類型(xíng))
JDK5之前我們覆蓋一個(gè)方法時我們無法改變被方法的返回類型,但在JDK5中我們可以改變它
例如1.4中我們隻能
public Object clone() { ... }
...
Employee cloned = (Employee) e.clone();
但是在5.0中我們可(kě)以(yǐ)改變返回類型為Employee
public Employee clone() { ... }
...
Employee cloned = e.clone();
11格式化I/O(Formatted I/O)
增加了(le)類似C的格式化輸入輸出,簡(jiǎn)單的例子:
public class TestFormat{
public static void main(String[] args){
int a = 150000, b = 10;
float c = 5.0101f, d = 3.14f;
System.out.printf("%4d %4d%n", a, b);
System.out.printf("%x %x%n", a, b);
System.out.printf("%3.2f %1.1f%n", c, d);
System.out.printf("%1.3e %1.3e%n", c, d*100);
}
}
輸出(chū)結果為:
150000 10
249f0 a
5.01 3.1
5.010e+00 3.140e+02
請描述您所遇(yù)到的錯誤,我們將盡快予以(yǐ)修正(zhèng),謝謝!
*必填項,請輸入內容