Something About String

Do You know there is a intern method this is used to ask in interviews.

The Interviewer just asked have you ever heard about intern method and he doesn’t tell

you about the name of the class from which it belongs,the simplicity is that intern is static method String class and if you want to create string using new operator and also you want to store it in java string pool so you should use intern method benifits is that you can compare two string using == operator.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s