The simplest programs read text from the keyboard and print results to the console. println writes a line with a newline; print writes without. Reading uses readLine(), which returns String? — nullable because the user might signal end-of-input (Ctrl+D / Ctrl+Z), so you must handle null.
Printing
Content is available with subscription.
Get full access to all courses on the platform for one year with a single payment.
▼
Unlike other platforms that charge per course, here you get everything for one price, and after one year of use there will be no automatic charge for the following year.