Question
This is for Intermediate Java Programming Program 1: Write a program that uses an ArrayList filled with a minimum of 10 Strings. Use a 'for-each'
This is for Intermediate Java Programming
Program 1: Write a program that uses an ArrayList filled with a minimum of 10 Strings. Use a 'for-each' loop to print the ArrayList collection. Then ask a user which element they would like to see again. Then, attempt printing the element in a try/catch format which will result in the element being displayed. If the element value received is invalid, display a message that an Exception has been thrown displaying "Out of Bounds". In this program, include the use of Autoboxing/Auto-Unboxing, working with a user String input.
Program 2: Write a program to create a new file titled data.file, if the file does not exist. Then write to the new file, adding 10 randomly generated numbers, or append 10 randomly generated numbers to a previous file. Each integer is to be separated by a space. Close the file, then reopen the file and read the data from the file and display it.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started