Write a Java program to replace all the ‘d’ characters with ‘f’ characters
In this demo I have used NetBeans IDE 8.2 for debugging purpose. But you can use any java programming language compiler as per your availability..
public class Javaexcercise { public static void main(String[] args) { String str = "TECHSTUDY - The Complete Debugging Solution"; // Replace all the 'd' characters with 'f' characters. String new_str = str.replace('T', 'Y'); // Display the strings for comparison. System.out.println("Original string: " + str); System.out.println("New String: " + new_str); } }
Result:
Original string: TECHSTUDY - The Complete Debugging Solution
New String: YECHSYUDY - Yhe Complete Debugging Solution
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
In this demo I have used NetBeans IDE 8.2 for debugging purpose. But you can use any java programming language compiler as per your availability..
Result:
Original string: TECHSTUDY - The Complete Debugging Solution
New String: YECHSYUDY - Yhe Complete Debugging Solution
need an explanation for this answer? contact us directly to get an explanation for this answer