output you can send any primitive type (numbers and characters)and string objects as wellto the display with these statementssystem out print(var)system out println(var)/displays varno linefeed /displays varthen starts new line the print(method leaves the cursor on the same lineprintln(moves it to the beginning of the next line in older versions of the sdka system out print(statement did not actually write anything to the screen it had to be followed by system out println()or system out flush(statement to display the entire buffer now it displays immediately you can use several variablesseparated by plus signsin the argument suppose in this statement the value of ans is system out println("the answer is ans)then the output will be the answer is inputting string input is considerably more involved than output in generalyou want to read any input as string object if you're actually inputting something elsesay character or numberyou then convert the string object to the desired type as we notedany program that uses input must include the statement import java io *at the beginning of the program without this statementthe compiler will not recognize such entities as ioexception and inputstreamreader string input is fairly baroque here' method that returns string entered by the userpublic static string getstring(throws ioexception inputstreamreader isr new inputstreamreader(system in)bufferedreader br new bufferedreader(isr)string br readline()return