bookmark.java
来自「书籍"Java_面向事件编程"的附带光盘代码」· Java 代码 · 共 37 行
JAVA
37 行
// Class to hold a pair of strings corresponding to a web URL // and the description that should be associated with the URL.public class Bookmark { private String description; // words describing web site private String address; // URL for the web site // save website description and address in new object public Bookmark(String theDescription, String theAddress) { description = theDescription; address = theAddress; } // return the website's description public String getDescr() { return description; } // return the website's URL or address public String getAddr() { return address; } // return a string showing contents of the bookmark public String toString() { return description + " ---> " + address; } // return a string encoding the bookmark in the standard // form browsers expect to find in bookmark files public String toBookmarkFileEntry() { return "<DT><A HREF=\"" + address + "\">" + description + "</A>"; } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?