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

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);

}

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the complete corrected program java import javautilScanner public class Exercise0422 p... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!