@@ -0,0 +1,511 @@
+// Use a static method.%0Aclass StaticMeth %7B%0A  static int val = 1024; // a static variable%0A  %0A  // a static method%0A  static int valDiv2() %7B%0A    return val/2;%0A  %7D%0A%7D%0A%0Aclass SDemo2 %7B%0A  public static void main(String args%5B%5D) %7B%0A    %0A    System.out.println(%22val is %22 + StaticMeth.val);%0A    System.out.println(%22StaticMeth.valDiv2(): %22 + StaticMeth.valDiv2());%0A    %0A    StaticMeth.val = 4;%0A    System.out.println(%22val is %22 + StaticMeth.val);%0A    System.out.println(%22StaticMeth.valDiv2(): %22 + StaticMeth.valDiv2());%0A  %7D%0A%7D%0A

Use a static method