?? cookiemonster.java
字號:
// access/cookie2/CookieMonster.java
// TIJ4 Chapter Access, Exercise 4, page 227
// Show that protected methods have package access but are not public.
/* In directory Cookie2:
* //access/cookie2/Cookie.java
* //Creates a library
* package access.cookie2;
*
* public class Cookie {
* public Cookie() {
* System.out.println("Cookie contstructor");
* }
* protected void bite() { System.out.println("bite"); }
* }
*/
package access.cookie2;
public class CookieMonster {
public static void main(String[] args) {
Cookie x = new Cookie();
x.bite(); // package access to protected method
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -