📄 iniblock.java
字号:
package chapter7;
public class IniBlock
{
static int[] staticValues = new int[10];
int[] nonStaticValues = new int[10];
static
{
System.out.println("初时化静态成员:");
for (int i =0;i< staticValues.length;i++)
{
staticValues[i] = (int) (100 * Math.random());
System.out.print(staticValues[i] + ",");
}
}
{
System.out.println();
System.out.println("初时化非静态成员:");
for (int i =0;i< staticValues.length;i++)
{
nonStaticValues[i] = (int) (100 * Math.random());
System.out.print(nonStaticValues[i] + ",");
}
}
public static void main(String [] args)
{
IniBlock ini1 = new IniBlock();
IniBlock ini2 = new IniBlock();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -