java 队列的实现
public static void main ( String args [ ] ) throws IOException { ArrayQueue arrayQueue = new ArrayQueue ( 3 ) ; char key = ' ' ; //接收用户输入 Scanner scan = new Scanner ( System . in ) ; boolean loop = true ; while ( loop ) { System . out . println ( "s:显示队列" ) ; System . out . println ( "e:退出程序" ) ; System . out . println ( "a:添加数据到队列" ) ; System . out . println ( "g:队列里取数据" ) ; System . out . println ( "h:显示头" ) ; System . out . println ( "r:显示尾" ) ; key = scan . next ( ) . charAt ( 0 ) ; switch ( key ) { case 's' : try { arrayQueue . showQueue ( ) ; System . out . println ( "已显示全部数据" ) ; }