📄 scope.txt
字号:
// Experiment with variable scope
import javax.swing.JOptionPane;
public class Scope
{
public static int b = 25;
// This is a class variable. It is not declared
// in the body of any methods. What do you think its
// scope will be?
public static void doStuff()
{
int a = 3;
if (a > b)
JOptionPane.showMessageDialog(null,
a + " is larger than " + b);
else
JOptionPane.showMessageDialog(null,
a + " is smaller than " + b);
}
public static void main(String[] args)
{
int a = 15;
int b = 2;
doStuff();
System.exit(0);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -