Meaningless Drivel is fun!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Strings" Watch "Strings" New topic


Karu Raj
Ranch Hand

Joined: Aug 31, 2005
Posts: 481
It prints True

what is the line at /////////////ABC does ???

if( "String".endsWith(""))///////////////ABC
marc weber

Joined: Aug 31, 2004
Posts: 11343

The empty String ("") can be found anywhere within a String...

(Consider that in mathematics, for any set S, the empty set is a subset of S.)

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
I agree. Here's the link:
subject: Strings
It's not a secret anymore!