bookmark.java

来自「java编程开发技巧与实例的编译测试通过的所有例程」· Java 代码 · 共 35 行

JAVA
35
字号

public class Bookmark
{
	protected String title, address, description, category;
	public Bookmark()
	{	title	=	address = description = category = "";	}
	public Bookmark(String _title, String _address)
	{
		title		=	_title;
		address		=	_address;
		description	=	category = "";
	}
	public String toString()
	{
		return title;
	}
	public static Bookmark[] getSampleBookmarks()
	{
		Bookmark url[]	=	new Bookmark[4];
		url[0]			=	new Bookmark("南京理工 University", "http://www.njust.edu.cn/");
		url[0].description	=	"南京理工大学";
		url[0].category		=	"Universitys";
		
		url[1]				=	new Bookmark("sharkka's blog", "http://sharkka.blog.hexun.com/");
		url[1].description	=	"BBS";
		url[2]				=	new Bookmark("Sohu", "http://www.sina.com.cn/");
		url[2].description	=	"The most popular search engine on the web";
		url[2].category		=	"Search Engines";
		url[3]				=	new Bookmark("Google", "http://www.google.com/");
		url[3].description	=	"Apretty goog alternative to Sohu.";
		url[3].category		=	"Search Engines";
		return url;
	}
}

⌨️ 快捷键说明

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