Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

B&S: find method process empty string "" as null

 
mohamed sulibi
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all;

my find method implementation process empty string "" as null so it return any value. so is it must to check if the column value is "" or not. and it is usal way ???


Best regards.
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My method did the same thing. I think it is ok as long as you document it. When do the find method and provide "" logically it is valid for all record because in my assignment, it says "Fred" match with "Fred" and "Freddy". So the empty String "" match with everything. Please consider the other suggestions.

good luck

Jeffry Kristianto Yanuar
Java Instructor
SCJP 5.0
SCJA
SCJD (Working on UrlyBird 1.3.2) --> testing and documenting the assignment
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!