overview this method returns string objectwhich is composed of characters typed on the keyboard and terminated with the enter key the details of the inputstreamreader and bufferedreader classes need not concern us here besides importing java io *you'll need to add throws ioexception to all input methodsas shown in the preceding code in factyou'll need to add throws ioexception to any methodsuch as main()that calls any of the input methods inputting character suppose you want your program' user to enter character (by enterwe mean typing something and pressing the enter key the user may enter single character or (incorrectlymore than one thereforethe safest way to read character involves reading string and picking off its first character with the charat(methodpublic static char getchar(throws ioexception string getstring()return charat( )the charat(method of the string class returns character at the specified position in the string objecthere we get the first characterwhich is number this approach prevents extraneous characters being left in the input buffer such characters can cause problems with subsequent input inputting integers to read numbersyou make string object as shown before and convert it to the type you want using conversion method here' methodgetint()that converts input into type int and returns itpublic int getint(throws ioexception string getstring()return integer parseint( )the parseint(method of class integer converts the string to type int similar routineparselong()can be used to convert type long in older versions of the sdkyou needed to use the line import java lang integerat the beginning of any program that used parseint()but this convention is no longer necessary