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

📄 teststack.java

📁 测试哈希表
💻 JAVA
字号:
import java.util.Stack;

public class TestStack{
	public void test(){
		Stack stkTemp=new Stack();
	print("堆栈是否为空:"+stkTemp.empty());	
	stkTemp.push(new String("第一个元素"));	
	print("堆栈是否为空"+stkTemp.empty());	
	stkTemp.push(new String("第二个元素"));
	print("栈内元素"+Integer.toString(stkTemp.search(new String("第一个元素"))));	
	print("栈顶元素为:"+stkTemp.pop().toString());
	print("栈顶元素为:"+stkTemp.peek().toString());
	print("栈顶元素为:"+stkTemp.pop().toString());
	print("是否为空:"+stkTemp.empty());	
		
		}
	public void print(Object ObInfo)
	{ 
	System.out.println(ObInfo);	
		
		}
	public static void main(String args[]){
		TestStack ts=new TestStack();
		ts.test();
		
		}
	
	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -