Add all the necessary exception declarations

Assignment Help JAVA Programming
Reference no: EM131588668

Add all the necessary exception declarations to remove the compile-time errors

import java.io.*; 
 
public class L9 { 
 
    public static String cat( String fileName ) { 
 
        FileInputStream fin = new FileInputStream( fileName ); 
 
        BufferedReader input = new BufferedReader( new InputStreamReader( fin ) ); 
 
        StringBuffer buffer = new StringBuffer(); 
 
        String line = null; 
 
        while ( ( line = input.readLine() ) != null ) { 
 
  line = line.replaceAll( "\s+", " " ); 
 
  buffer.append( line ); 
 
        } 
 
        fin.close(); 
 
        return buffer.toString(); 
 
    } // End of cat 
 
    public static void main( String[] args ) { 
 
        System.out.println( cat( args[ 0 ] ) ); 
 
    } 
}

Reference no: EM131588668

Questions Cloud

Create five questions for your questionnaire : Select an organizational issue, problem, or topic that you would like to research based on the work you did in unit one with the worksheets .
Compare and contrast anorexia : Compare and contrast anorexia, bulimia, and obsessive-compulsive disorder
Design the logic for a program : Draw a flowchart and write pseudocode to design the logic for a program that allows a user to enter 12 numbers, and then displays the numbers.
How much interest expense was accrued on december : If Jupiter Company only adjusts its accounts once a year at year-end, how much interest expense was accrued on December 31, 2016
Add all the necessary exception declarations : Add all the necessary exception declarations to remove the compile-time errors
Explain the cognitive processes of adaptation : Explain the cognitive processes of adaptation as they relate to schema and identify the differences between the two
What is endorsement key : Can you explain what is endorsement key, storage root key and public-private key pairs in trusted platform module and how it works?
What was sarasota corps times interest earned : In a recent year Sarasota Corp. had net income of $159000, interest expense of $31100, What was Sarasota Corp.'s times interest earned (rounded) for the year
File handling and applications : Design the logic for a program, using pseudocode, that merges the files for summer and winter programs to create a list of the first and last names.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a method that returns the last digit of an integer

Write a method named lastDigit that returns the last digit of an integer - It should work for negative numbers as well.

  Define render a model scene in java

Render a Model Scene in Java - Imagine you are prototyping animation for a Jurassic Park Movie

  Design your own three-stage explicit runge-kutta method

Design your own three-stage explicit Runge-Kutta method with one-step error O(h^4) - Confirm that the global error in your numerical solution is O(h^3).

  Write a program called render.java

Optionally you may wish to add texture mapping to make your models look more realistic, and you may want to supply the user some controls that affect the colours and lighting.

  What attributes would your class have

What attributes would your class have? What methods would your class have - In the HelloWorld program, what is "public" that appears on the line that defines the main method?

  Implemented a distributed rental car management system

You implemented a distributed rental car management system using Java TCP Sockets and object streams. The goal of this project is to use code from your TCP project and create a new implementation of the rental car management system using Java RMI

  Write a class to encapsulate data and behavior of a product

Create a class to encapsulate the data and behavior of a product in a store's inventory. The class should have the following data for an inventory item: Product Number - String.

  Determine the length of the string

You must give your user three opportunities for wrong input before you terminate the program.

  Create an array that stores in integers from the keyboard

create an array that stores in integers from the keyboard and then I can scan that array to check numbers in order, if the number I check is greater than the previous then I will set the next number in the array to the higher value.

  Implement a method with three arguments

Implement a method with three arguments: a graph, a starting vertex number, and an ending vertex number. The method determines whether there is a directed path from the starting vertex to the ending vertex.

  Java program which demonstrates cellular automata

Using the internet, locate a Java program (or Java applet) which demonstrates "Cellular Automata", in particular "the Game of Life".

  The business world would be concerned with assertions

100-300 Words. What might be some of the issues that the business world would be concerned with assertions?  For example, if I don't get my newspaper delivered, this is something that needs to be flagged.  Where do you see the businesses in your comm..

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