fork download
  1.  
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. class Demo {
  8. int variable = 5;
  9. void method() {
  10. int variable = 40;
  11. System.out.println("Value of Instance variable :" + this.variable);
  12. System.out.println("Value of Local variable :" + variable);
  13. }
  14. public static void main(String args[]) {
  15. Demo obj = new Demo();
  16. obj.method();
  17. }
  18. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
Value of Instance variable :5
Value of Local variable :40