SHARE
TWEET

Method of null object

Archon May 29th, 2013 26 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Top