Advertisement
Archon

Method of null object

May 29th, 2013
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.23 KB | None | 0 0
  1. public class C{
  2.     int x;
  3.     void noChange(){ }
  4.     void change(){ x = 0; }
  5. }
  6.  
  7. public class Test{
  8.     public static void main(String args[]){
  9.         C obj = null;
  10.         obj.noChange();
  11.         obj.change();
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement