?? accessotherclass1.java
字號:
//c3:AccessOtherClass1.java
//author:ZhangHongbin
//This program is protected by copyright laws.
//Access in a class.
public class AccessOtherClass1
{
void m1()
{
OtherClass1 oc1=new OtherClass1();
oc1.sex=1;
System.out.println("sex= "+oc1.sex);
}
public static void main(String[] args)
{
OtherClass1 oc2=new OtherClass1();
oc2.sex=2;
System.out.println("sex= "+oc2.sex);
oc2.m2();
}
}
class OtherClass1
{
int sex;
void m2()
{
System.out.println("m2()");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -