Chapter

Comparisons

From ComputerScienceOne by Dr Chris Bourke

Concepts

  1. How can you create arrays and collections of strings in Java?

    "We can create our own arrays of strings similar to how we created arrays of int and double types.\n\nString names[] = new String[5];\n\nnames[0] = \"Margaret Hamilton\";\n\nnames[1] = \"Ada Lovelace\

  2. How do you compare strings in Java?

    "When comparing strings in Java, we cannot use the numerical comparison operators such as ==, or <. Because strings are objects, using these operators actually compares the variables’ memory addresses

Comparisons | ComputerScienceOne | Bifalgorithm | Bifalgorithm