Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Java Exception

$
0
0
Write a Java class named FileIO with the static methods listed below. Each method should rethrow any exceptions of the type IOException as a FileIOException.
public static String readOneString( String filename )
throws FileIOException
public static char readOneChar( String filename )
throws FileIOException
public static float readOneFloat( String filename )
throws FileIOException
public static String[] readAllStrings( String filename )
throws FileIOException
public static char[] readAllChars( String filename )
throws FileIOException
public static float[] readAllFloats( String filename )
throws FileIOException
public static void writeOneString( String data,
String filename ) throws FileIOException
public static void writeOneChar( char data,
String filename ) throws FileIOException
public static void writeOneFloat( float data,
String filename ) throws FileIOException
public static void writeAllStrings( String[] strArray,
String filename ) throws FileIOException
public static void writeAllChars( char[] charArray,
String filename ) FileIOException
public static void writeAllFloats( float[] floatArray,
String filename ) throws FileIOException
• readOneString(), readOneChar(), and readOneFloat() are for reading single data items from a file
• readAllStrings(), readAllChars(), and readAllFloats() are for reading in all the data from a file and should return it in an array of the appropriate type
• writeOneString(), writeOneChar(), and writeOneFloat() are for writing single data items to a file
• writeAllStrings(), writeAllChars(), and writeA

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>