📄 stacktest.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -