
π 06. Java Self-Study: Variables & System I/O
Topic: Section 2-4 (Variables and System I/O) Date: 2026-03-12 1. System I/O (System.in / System.out) I finally understand the meaning behind System.out.println() , which I had been using without much thought. System.out (Standard Output): Monitor System.in (Standard Input): Keyboard 2. Output Methods: print, println, and printf There are more ways to output data than just println . print(): Outputs content without a newline. println(): Outputs content and moves to the next line. printf(): Outputs formatted content. This is essential for controlling decimal places or aligning data in professional projects. π‘ Understanding the Format Specifier: %-10.2f It looked complicated at first, but it's actually quite logical: % : Start of the format specifier. - : Left-aligned (remaining space on the right is filled with blanks). 10 : Total width (occupies 10 spaces, including the decimal point). .2 : Limits the output to 2 decimal places. f : Formats the value as a floating-point number. Note: Y
Continue reading on Dev.to
Opens in a new tab

