⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stacktest.java

📁 java手机程序设计入门配套的源代码 很详细 感觉很好
💻 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 + -