国外的数据结构与算法分析用书

源代码在线查看: book.java

软件大小: 2111 K
上传用户: Emouse
关键词: 数据结构 算法分析
下载地址: 免注册下载 普通下载 VIP

相关代码

				package patronBook;
				
				/**	A class representing a book.  It has an out routine, and attributes 
					title, author, and isbn number. */
				public class Book
				{
					/**	Fields of a book */
					protected String title, author, isbn;
					
					/**	Create a new book
						Analysis: Time = O(1) */
					public Book(String t, String a, String i)
					{
						title = new String(t);
						author = new String(a);
						isbn = new String(i);
					}
					
					/**	Returns a string representation of the book
						Analysis: Time = O(1) */
					public String toString()
					{
						String temp = new String();
						temp =  "title:  " + title + "\n";
						temp = temp + "author: " + author + "\n";
						temp = temp + "isbn:   " + isbn + "\n";
						return temp;
					}	
				}
							

相关资源