首页 > 代码库 > 变量作用域

变量作用域

package com.demo;

import org.junit.Test;

public class VariableTest {
    int i = 9;
    @Test
    public void say() {
        System.out.println(i);
        System.out.println(j);
    }
    
    int j = 10;
}

运行结果:

9
10

 

变量作用域