The program will not compile as you cannot use a numeric value as the file title as
Fantastic news! We've Found the answer you've been seeking!
Question:
The program will not compile as you cannot use a numeric value as the file title as you also cannot use it as a class name. Also no comments." Please help me fix it thank you.
import java.util.Scanner;
public class Exercise_04_22 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter string s1: ");
String s1 = in.nextLine();
System.out.print("Enter string s2: ");
String s2 = in.nextLine();
if (s1.indexOf(s2) != -1) {
System.out.printf("%s is a substring of %s%n", s2, s1);
} else {
System.out.printf("%s is not a substring of %s%n", s2, s1);
}
}
}
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: