• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt about using 'null'  RSS feed

 
surendar prabu
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference in behaviour of null when used on

String s1=null;

and

MyObject myo=null;

regards
Surendarprabu
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No idea what you're asking. "null" means "no object", and it can be assigned to a variable of any reference type. String is no different from any other class in this respect or in virtually any other respect.
 
Svend Rost
Ranch Hand
Posts: 904
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no difference.

Do you see different behaviour in your code when your setting a String
object and a MyObj object to null ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!