2 example of comparing string in Java

Tutorials Shared by the Internet Community

Advertisements


2 example of comparing string in Java

There are many ways to compare two strings in java. this Java program example explores four different way e.g. using ==, equals, equasIgnoreCase and C

Statistics

  • Total Hits - 31380

  • Total Votes - 113 votes

  • Vote Up - 52 votes

  • Vote Down - 61 votes

  • Domain - javarevisited.blogspot.com

  • Category - JAVA/Core JAVA

  • Submitted By - Javin Paul

  • Submitted on - 2012-07-14 14:30:18

Description

There are many ways to compare two strings in java. this Java program example explores four different way e.g. using ==, equals, equasIgnoreCase and CompareTo. Many people make mistake of comparing String using == operator which is not correct if you are comparing String for content than use equals() method.    More detail...


Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements