This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String array with null or """

 
Pauline McNamara
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any difference between using null or "" in a String array? (Or null and the equivalent "empty element" in other array types?)
( String[ ] oneExample = { null , "1" , "2" } ) == ( String[ ] anotherExample = { "" , "1" , "2" } ) ?
thanks, Pauline
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Try it and see for yourself
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic