06 October 2010

(confusion code) check out what the output..???

public class CDummy
{
       static int toto = 7;

       CDummy getDummy() {
              return null; // pay attention here !
       }

       public static void main(String args[])
       {
              System.out.println("CDummy.");

              CDummy dmy = new CDummy();

              System.out.println(dmy.getDummy().toto);
       }
}

can you guess the output of the above code ? (try not to run the code)

plz replay me....

6 comments: