Question: Write the following method that returns true if string str1 is a prefix for string s. public static Boolean isPrefix(String s, String str1) Write a

Write the following method that returns true if string str1 is a prefix for string s. public static Boolean isPrefix(String s, String str1) Write a test program (main method) that prompts the user to enter string s and str1, and displays whether str1 is a prefix for s. Note: For this problem, arrays or lists are not to be used. Here is sample: Enter string s: Java Programming Enter prefix string: Java Java is a prefix for Java Programming Enter string s: Java Programming Enter prefix string: java java is not a prefix for Java Programming
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
