
February 1st, 2013, 03:09 PM
|
|
|
Change the line:
Code:
if (internetType == "A"){
to:
Code:
if (internetType.equals("A")){
The reason is that a String is handled like an Object. To perform equality checks with a String (and any other Object or subclass of Object) you use the 'equals'-method. Frankly, the == operator is also an equality operator for objects, but it checks if the references are equal (or in other words: if both objects are on the same memory position).
This only holds for objects. If you want to test for equality with primitive types, such as int, byte, boolean, char, then you can use the == operator
|