Rename the public class accordingly

Assignment Help Basic Computer Science
Reference no: EM131781219

import java.io.BufferedReader; 

import java.io.IOException; 

import java.io.InputStreamReader; 

import java.util.ArrayList; 

public class Ex02 { 

   public static void main(String[] args) throws IOException { 

       BufferedReader userInput = new BufferedReader 

           (new InputStreamReader(System.in));

       ArrayList<String> myArr = new ArrayList<String>();

       myArr.add("Zero");

       myArr.add("One");

       myArr.add("Two");

       myArr.add("Three");

       System.out.println(myArr.get(6)_;

   } 

}

Starting with this provided code, add the following functionality:

1. Use a Try/Catch block so that the exception is caught and the program exits a bit more gracefully. Save this file as TryCatch.java. (Be sure to rename the Public Class accordingly.)

Starting with the provided code again (without the Try/Catch block), fix the code so that it runs correctly. That is to say, it should display the last item in the ArrayList. Save this file as Fixed.java.

Reference no: EM131781219

Questions Cloud

About the product life cycle : Which of the following is FALSE about the Product Life Cycle (PLC)?
Discuss the company would focus on kentucky and open stores : O'Mally Department Stores is considering two possible expansion plans. One proposal involves opening 5 stores in Indiana
Maintenance phase of the sdlc : Speculate why the maintenance phase of the SDLC is so much larger than other the other phases.
Attributable to the technology stage of innovation lifecycle : Which product that was developed by Microsoft is attributable to the technology stage of the innovation lifecycle.
Rename the public class accordingly : Use a Try/Catch block so that the exception is caught and the program exits a bit more gracefully. Save this file as TryCatch.java.
Discuss the reinstatement of section in the tax year : Assignment: Section 179 of the Internal Revenue Code - Discuss the reinstatement of Section 179 in the tax year 2014
What the articles you have selected say about the theme : What the articles you have selected say about the theme. Where do they agree? Where do they disagree?
Produce two units of new cruise missile guidance control : United Research Associates (URA) had received a contract to produce two units of a new cruise missile guidance control.
Microformat data : Given the following HTML, add the following microformat data:

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Analyst to design new admission - registration system

Analyst to design its new admission/registration system -  It is a small private college with nearly 3,000 students, 100 faculty, and 50 supporting staff (including 10 full-time and four part-time IT staff who are responsible for supporting all aca..

  Find the resultant force on the object

If an object experiences a force with a horizontal component of 2.5 N and a vertical component of 3.1 N as well as a second force with a horizontal component of 6.2 N and a vertical component of 4.3 N, find the resultant force on the object. Write..

  Database functionality and security

Sonny company is currently evaluating its database functionality and security. Explain to the company manager whether he/she has to develop the existing system or create a new one.

  Keep transcript data on students

Assume a College database has a table to keep transcript data on students. The transcript table has fields for SSN, TotalPoints, and TotalCredits.

  Analyze the important principles and practices

From the e-Activity, analyze the important principles and practices that are driving the current trends in software development that you researched.From the e-Activity and the knowledge gained from Chapter 14 of the text, predict key trends that you ..

  Work breakdown structure for emr implementation

Need help with work breakdown structure for EMR implementation

  A flow chart and a pseudocode

A flow chart and a pseudocode

  Beginning of the data structure

Which addressing modes facilitates access to an operand whose location is defined relative to the beginning of the data structure in which it appears?

  Which of the indexes are dense, and which are not

Which of the indexes are dense, and which are not?

  Explain whether or not believe there discernible difference

Explain whether or not you believe there is a discernible difference in efficiency between compressing and decompressing audio data and compressing and decompressing image data.

  Write a c program that implements a shell

Write a C program that implements a shell.

  Would you make changes to the list of sites for these zones

On the computer you typically use, find out whether any Web sites are listed in the Trusted or Restricted zones. Would you make changes to the list of sites for these zones? Explain why or why not.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd