stacktest.java
来自「java手机程序设计入门配套的源代码 很详细 感觉很好」· Java 代码 · 共 38 行
JAVA
38 行
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.util.* ;
public class StackTest extends MIDlet
{
public StackTest()
{
}
public void startApp()
{
Stack s = new Stack() ;
s.push(new Integer(3)) ;
s.push(new Integer(1)) ;
s.push(new Integer(1)) ;
s.push(new Integer(7)) ;
while(!s.empty())
{
System.out.println(s.pop()) ;
}
s.push(new Integer(5)) ;
s.push(new Integer(1)) ;
s.push(new Integer(4)) ;
s.push(new Integer(2)) ;
Enumeration e = s.elements() ;
while(e.hasMoreElements())
{
System.out.println(e.nextElement()) ;
}
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?