October 2017
Beginner
318 pages
7h 26m
English
Now it's probably time to write our conditional statement. Let me introduce you to a new string function called the contains function:
if(input.contains())
The contains function takes as input a sequence of characters of which a string qualifies. As output, it gives us a Boolean value, which means it will either output TRUE or FALSE. So our if statement should understand the result of this function and evaluate to the same. To test our program, let's start by simply going through the following process.
We'll provide our contains function with the value stored in the sOne string which is abc:
package complexconditionals; import java.util.*; public class ComplexConditionals { public static void main(String[] args) { Scanner ...Read now
Unlock full access