?? getmaxminvalue.java
字號:
/*
* GetMaxMinValue.java
*
* Created on 2005年1月31日, 下午3:59
*/
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
* 顯示基本數據類型的最大值和最小值
* <p>
* @author 劉斌
* @version
*/
public class GetMaxMinValue extends MIDlet {
private Form form = new Form("顯示最大最小值");
public void startApp() {
Display.getDisplay(this).setCurrent(form);
outputMinMaxValue();
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
/**
* 顯示最大最小值
*/
private void outputMinMaxValue() {
String osMin, osMax;
osMax = "int最大值:" + Integer.MAX_VALUE;
osMin = "int最小值:" + Integer.MIN_VALUE;
out(osMax);
out(osMin);
osMax = "short最大值:" + Short.MAX_VALUE;
osMin = "short最小值:" + Short.MIN_VALUE;
out(osMax);
out(osMin);
osMax = "byte最大值:" + Byte.MAX_VALUE;
osMin = "byte最小值:" + Byte.MIN_VALUE;
out(osMax);
out(osMin);
osMax = "long最大值:" + Long.MAX_VALUE;
osMin = "long最小值:" + Long.MIN_VALUE;
out(osMax);
out(osMin);
osMax = "char最大值:" + (int)Character.MAX_VALUE;
osMin = "char最小值:" + (int)Character.MIN_VALUE;
out(osMax);
out(osMin);
osMax = "float最大值:" + Float.MAX_VALUE;
osMin = "float最小值:" + Float.MIN_VALUE;
out(osMax);
out(osMin);
osMax = "double最大值:" + Double.MAX_VALUE;
osMin = "double最小值:" + Double.MIN_VALUE;
out(osMax);
out(osMin);
}
/**
* 在標準輸出和窗口中輸出信息
*/
private void out(String msg) {
System.out.println(msg);
form.append(msg+"\n");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -