📄 unsafestack.java
字号:
public class UnsafeStack implements StackInterface
{
private int top = 0;
private int[] values = new int[10];
public void push(int n)
{
values[top] = n; //5
System.out.println("压入数字"+n+"步骤1完成");
top++; //6
System.out.println("压入数字完成");
}
public int[] pop()
{
System.out.print("弹出");
top--; //7
int[] test = {values[top],top}; //8
return test;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -