⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scope.txt

📁 java的一经典教程
💻 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 + -