Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Output in Java<br />
Output<br />System.out.println(“Hello”);<br />Notes:<br />Capital letter S in System<br />Use the dot (.) after System and...
Output<br />System.out.println();<br />This statement will leave a blank line on the screen<br />System.out.println(“     ...
Output<br />System.out.println(“Hello”);<br />Note:<br />Leaving space before the System.out.println statement will not in...
Output<br />Difference between the methods print and println<br />System.out.println(“Hello”);<br />This will output the w...
Output<br />Examples<br />System.out.println(“Welcome ”);<br />System.out.println(“to Java ”);<br />Will output:<br />Welc...
Output<br />Examples<br />System.out.print(“Welcome ”);<br />System.out.print(“to Java ”);<br />Will output:<br />Welcome ...
Upcoming SlideShare
Loading in …5
×

01 output in java

445 views

Published on

Teaches how to get output in Java

Published in: Education
  • Be the first to comment

  • Be the first to like this

01 output in java

  1. 1. Output in Java<br />
  2. 2. Output<br />System.out.println(“Hello”);<br />Notes:<br />Capital letter S in System<br />Use the dot (.) after System and out<br />Whatever is between the quotes “” will be displayed when the program is executed<br />A semicolon (;) must be used at the end of the line<br />
  3. 3. Output<br />System.out.println();<br />This statement will leave a blank line on the screen<br />System.out.println(“ Hello”);<br />This statement will leave some space on the left hand side of the screen an then print the word Hello<br />
  4. 4. Output<br />System.out.println(“Hello”);<br />Note:<br />Leaving space before the System.out.println statement will not in any way affect the output. Java ignores the space. In order to affect the output, the space must be left somewhere between the quotes (“”)<br />
  5. 5. Output<br />Difference between the methods print and println<br />System.out.println(“Hello”);<br />This will output the word Hello and then move the cursor to the next line<br />System.out.print(“Hello”);<br />This will output the word Hello and then keep the cursor on the same line<br />
  6. 6. Output<br />Examples<br />System.out.println(“Welcome ”);<br />System.out.println(“to Java ”);<br />Will output:<br />Welcome<br />to Java<br />
  7. 7. Output<br />Examples<br />System.out.print(“Welcome ”);<br />System.out.print(“to Java ”);<br />Will output:<br />Welcome to Java<br />

×