300cf57298f4001b1767ee232a2585d9

来自「Internet 开发技术分章节代码和自己完成的课程设计全代码(在zuoye文件」· 代码 · 共 30 行

TXT
30
字号
package bean;
import java.util.Vector;
import bean.Item;
public class Book {
	 private Vector items = new Vector();
	 public Book()
	 {
	  String s0="书名: JSP实用教程<BR>出版社: 清华大学出版社<BR>价格: 32.00元";	 
	  String s1="书名: 面向对象的程序<BR>出版社: 西安电子科技大学出版社<BR>价格: 28.00元";
	  String s2="书名: XML基础教程<BR>出版社: 清华大学出版社价格: 21.00元<BR>";
	  String s3="书名: 精通Java中间件编程<BR>出版社: 清华大学出版社<BR>价格: 21.00元";
	  String s4="书名: 计算机图形学<BR>出版社: 西安电子科技大学出版社<BR>价格: 25.00元";
	  String s5="书名: 人工智能原理与技术<BR>出版社: 西安电子科技大学出版社<BR>价格: 20.00元";	  
	  items.addElement(new Item("0",s0));
	  items.addElement(new Item("1",s1));
	  items.addElement(new Item("2",s2));
	  items.addElement(new Item("3",s3));
	  items.addElement(new Item("4",s4));
	  items.addElement(new Item("5",s5));
	}	 
	 synchronized public Vector getItems() { return items;  } 
    synchronized public Item getItem(String id) {
	    int index = Integer.parseInt(id);
	    return (Item)items.elementAt(index);
	  } 
    synchronized public void setItem(Item item,String id) {
	    int index = Integer.parseInt(id);
	    items.set(index,item);
	  }
}

⌨️ 快捷键说明

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