0% found this document useful (0 votes)
12 views1 page

Java String Replacement Example

The document contains a Java program that prompts the user to enter a string. It replaces all occurrences of the character 'a' with 'A' and prints the modified string. There are some syntax errors present in the code, such as incorrect use of quotation marks and capitalization in keywords.

Uploaded by

crystaljhoyl
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Java String Replacement Example

The document contains a Java program that prompts the user to enter a string. It replaces all occurrences of the character 'a' with 'A' and prints the modified string. There are some syntax errors present in the code, such as incorrect use of quotation marks and capitalization in keywords.

Uploaded by

crystaljhoyl
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Import [Link].

Scanner

public class Main{

public static void main(String[]args)

Scanner in = new Scanner([Link]);

[Link](“Enter a string: “);

String str1 = [Link]():

String replaceString = [Link](‘a’, ‘A’);

[Link](replaceString);

If ([Link]() >o)

You might also like