- class Date
- {
- private int time;
- public void getTime() {
- final int num = 3;
- class Inclass
- {
- int num = 4;
- public void printString()
- {
- int num = 5;
- System.out.println("Time:"+time+"num:"+this.num);
- }
- }
- new Inclass().printString();
- }
- }
- class Demo
- {
- public static void main(String[] args)
- {
- new Date().getTime();
- }
- }
复制代码
如何打印出printString方法中被final修饰过的num值? |
|