1
1
Fork 0
AtomicKotlinCourse/Introduction to Objects/Objects Everywhere/Exercise 5/task.md

1.1 KiB

Mastering the IDE: Completion

In Kotlin, it's easy to explore classes using IntelliJ IDEA, which has code completion. IDEA attempts to complete what you're typing and show you a list of options. After you type the dot, IDEA suggests members which can be called on a given element. You can also call completion explicitly by pressing &shortcut:CodeCompletion;.

Use &shortcut:EditorDown; and &shortcut:EditorUp; to select the required member and press &shortcut:EditorEnter; to paste it.

&shortcut:CodeCompletion; discovers all possible operations for a class. You can type the first letters of a member function or property to see all the available members starting with these letters, or simply containing these letters.

Type the identifier name r followed by a dot, then press &shortcut:CodeCompletion; to see the possible completions. Choose r.sum() and s.reversed() by typing only the first letters and using code completion.