Guest User

Untitled

a guest
Apr 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. ut i am able to change the value of static variable
  2. class Test
  3.  
  4. {
  5.  
  6.  
  7. static int a =10;
  8. public static void main(String args[])
  9.  
  10. {
  11. a=20;
  12.  
  13. System.out.println("rest of the code...");
  14.  
  15.  
  16.  
  17. Test1 t= new Test1();
  18.  
  19. t.m();
  20. }
  21. }
  22.  
  23.  
  24. public class Test1 {
  25. void m ()
  26. {
  27. System.out.println(Test.a);
  28. }
  29. }
Add Comment
Please, Sign In to add comment