Zoo tutorials: [ SQL | Linux | XML ]
ProgZoo: [ Java | C# | VB | C++ | Perl ]
Log in

A Gentle Introduction to
Programming

Tests - Checking if two strings are equal

 

Tests

Tests - Checking if two strings are equal

1. [ Java ] Test a string


Big

We use the .equals method to check if strings are the same. Beware: the test s1==s2 is allowed by the compiler - but it does not check the contents of the strings.

The code selects France and shows all details.