Amit Dave's Avatar
Newbie Member
Hi Chasey,

It is very difficult to tell you how to test EasyIn class without knowing what it contains.
Kindly tell us in details what all methods it have, whether they are static or not and what they do.
Or at least give the code of EasyIn class so that we could help you properly to solve your query.

Regards
Amit Dave
chasey's Avatar, Join Date: Jul 2006
Light Poster
here the info on easy in class


Class EasyIn
java.lang.Object
|
+--uwejava.EasyIn

--------------------------------------------------------------------------------

public abstract class EasyIn
extends java.lang.Object

This class contains easy to use input methods as described in the the text book "Java - The First Semester" by Quentin Charatan and Aaron Kan.

For convenience, the class has been moved into the "uwejava" package, so you must put the following line at the start of every program that uses it:
import uwejava.*;

Note that you must not/cannot create any objects of this class, so a typical method call has the form:
String s = EasyIn.getString ();



--------------------------------------------------------------------------------

Constructor Summary
protected EasyIn()
Note that you can't create any objects of this class and so it is not necessary to use the constructor
Method Summary
static byte getByte()
Read a small number from the keyboard and return it as a byte (8 bit) value.
static char getChar()
Read a single character from the keyboard and return it as a char value.
static double getDouble()
Read a floating point number number from the keyboard and return it as a double value.
static float getFloat()
Read a floating point number number from the keyboard and return it as a float value.
static int getInt()
Read a number from the keyboard and return it as an int value
static long getLong()
Read a number from the keyboard and return it as a long integer (64 bit) value.
static short getShort()
Read a number from the keyboard and return it as a short integer (16 bit) value.
static java.lang.String getString()
Get a complete line of input from the keyboard and return it as a String value.
static void pause()
Wait until the user presses [return]
static void pause(java.lang.String messageIn)
Write the specified message and wait until the user presses [return]
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait


Constructor Detail


EasyIn
protected EasyIn()Note that you can't create any objects of this class and so it is not necessary to use the constructor

Method Detail

getString
public static java.lang.String getString()Get a complete line of input from the keyboard and return it as a String value.

Example call:

String str = EasyIn.getString ();


--------------------------------------------------------------------------------

getInt
public static int getInt()Read a number from the keyboard and return it as an int value

Example call:

int i = EasyIn.getInt ();


--------------------------------------------------------------------------------

getByte
public static byte getByte()Read a small number from the keyboard and return it as a byte (8 bit) value.

Note that this method is not recommended for general use by novice programmers. In most cases, getInt () is preferred

Example call:

byte b = EasyIn.getByte ();


--------------------------------------------------------------------------------

getShort
public static short getShort()Read a number from the keyboard and return it as a short integer (16 bit) value.

Note that this method is not recommended for general use by novice programmers. In most cases, getInt () is preferred

Example call:

short s = EasyIn.getShort ();


--------------------------------------------------------------------------------

getLong
public static long getLong()Read a number from the keyboard and return it as a long integer (64 bit) value.

Note that this method is not recommended for general use by novice programmers. In most cases, getInt () is preferred

Example call:

long l = EasyIn.getLong ();


--------------------------------------------------------------------------------

getDouble
public static double getDouble()Read a floating point number number from the keyboard and return it as a double value.

Example call:

double d = EasyIn.getDouble ();


--------------------------------------------------------------------------------

getFloat
public static float getFloat()Read a floating point number number from the keyboard and return it as a float value.

Note that this method is not recommended for general use by novice programmers. In most cases, getDouble () is preferred

Example call:

float f = EasyIn.getFloat ();


--------------------------------------------------------------------------------

getChar
public static char getChar()Read a single character from the keyboard and return it as a char value.

Example call:

char ch = EasyIn.getChar ();


--------------------------------------------------------------------------------

pause
public static void pause()Wait until the user presses [return]

If you put a call to this method as the final statement of your main () method, then the program window will remain open until you enter [return]

Example call:

EasyIn.pause ();


--------------------------------------------------------------------------------

pause
public static void pause(java.lang.String messageIn)Write the specified message and wait until the user presses [return]

If you put a call to this method as the final statement of your main () method, then the program window will remain open until you enter [return]

Example call:

EasyIn.pause ("Press RETURN to continue");