Posts

Showing posts with the label io streams in java

Input and output in java

Image
Input and Output (IO) are mainly used concepts in java real time applications to share objects from one place to another. Input represents data given to a program and output represents data displayed as a result of program. We are already familiar with the following two statements to display the output. 1 2 System . out . print (); System . out . println ();                 Both of the statements are used to show the output on the screen. The difference between these two is that print() method keeps cursor in the same line after displaying the output and println() throws cursor to the next line after displaying the result. Example to show the differences between print() and println() methods: 1 2 3 4 5 6 7 8 9 10 public class Sysout { public static void main ( String [] args ){ int a , b ; a = 10 ; b = 15 ; c...