Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Anpu Massri   on Apr 19 In Java Category.

  
Question Answered By: Luz Hayes   on Apr 19

it should read:
if( s.equals(contentFlag))

This will return true if the content of s and the
content of contentFlag are the same.

By putting if(s == contentFlag)
you are checking to see if s and contentFlag refer to
the same object.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on problem with string comparison Or get search suggestion and latest updates.


Tagged: