Question: i need the codes of these two exercises in java pls Exercise # 1: (ArrayIndexOutOfBoundsException) Using the two arrays shown below, write a program that
Exercise \# 1: (ArrayIndexOutOfBoundsException) Using the two arrays shown below, write a program that prompts the user to enter an integer between 1 and 12 and then displays the months and its number of days corresponding to the integer entered. Your program should display "wrong number" if the user enters a wrong number by catching ArrayIndexOutOfBoundsException. Exercise \# 2: (Replacing Text) Write a class named ReplaceText that replaces a string in a text file with a new string. The filename and strings are passed as command-line arguments as follows: java ReplaceText sourceFile targetFile oldString newString For example, invoking java ReplaceText FormatString.java t.txt StringBuilder StringBuffer replaces all the occurrences of StringBuilder by StringBuffer in FormatString.java and saves the new file in t.txt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
