Question: / / Program accepts a String and displays some facts import java.util. * ; public class DebugSeven 3 { public static void main ( String

// Program accepts a String and displays some facts
import java.util.*;
public class DebugSeven3
{
public static void main(String[] args)
{
Scanner kb = new Scanner(System.in);
String quote, charString;
char searchChar;
System.out.print("Enter a famous quote >>");
quote = nextLine();
System.out.print("Enter a character to search for >>");
charString = kb.nextInt();
searchChar = charString.charAt(0);
System.out.println("index of('"+ searchChar +"') is: "+ quote.indexOf(searchChar);
System.out.println("index.of('a') is: "+ quote.indexOf'a');
System.out.println("index.of('x') is: "+ quote.indexOf('x'));
System.out.println("char.At(5) is: "+ quote.charAt(5));
System.out.println("replace('e','*') is: "+
quote.repplace('e','*'));
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!