Cov txheej txheem:

Kotlin REPL yog dab tsi?
Kotlin REPL yog dab tsi?

Video: Kotlin REPL yog dab tsi?

Video: Kotlin REPL yog dab tsi?
Video: Kev Ntseeg Yog Dabtsi Tiag (What Faith Really Is) | Zaj 2 | Kx. Ntxoov Lis Yaj 2024, Hlis ntuj nqeg
Anonim

REPL (Nyeem-Eval-Print-Loop) yog ib qho cuab yeej rau kev khiav Kotlin code sib tham sib. REPL cia koj ntsuam xyuas cov kab lus thiab cov lej chunks yam tsis tau tsim cov haujlwm lossis txawm tias ua haujlwm yog tias koj tsis xav tau. khiav REPL hauv IntelliJ IDEA, qhib Cov Cuab Yeej | Kotlin | Kotlin REPL.

Kuj paub, kuv yuav hloov kotlin rau Java li cas?

  1. qhib cov ntaub ntawv kotlin hauv android studio.
  2. mus rau cov cuab yeej -> kotlin -> kotlin bytecode.
  3. nyob rau hauv lub qhov rais tshiab uas qhib ib sab koj cov ntaub ntawv kotlin, nyem lub pob decompile. nws yuav tsim java sib npaug ntawm koj cov ntaub ntawv kotlin.

Tsis tas li ntawd, kotlin puas yog OOP? Object-Oriented Programming hauv Kotlin . Kotlin yog ib object-oriented programming ( OOP ) lus nrog kev txhawb nqa rau kev ua haujlwm siab dua thiab lambdas. Koj tuaj yeem saib txhua yam khoom ua lub khoos phis tawj me ntawm nws tus kheej: nws muaj lub xeev thiab tuaj yeem ua haujlwm.

Tom qab ntawd, lo lus nug yog, Kotlin compiler ua haujlwm li cas?

- [Instructor] Kotlin compiles rau Java bytecode, ib yam li Java code, thiab raug tua ntawm runtime los ntawm Java virtual tshuab. java, thiab thaum nws tau ua raws li bytecode, nws dhau los ua cov ntaub ntawv hu ua Main. chav kawm. Koj tuaj yeem nqa chav kawm no thiab khiav nws saum lub tshuab Java virtual, nrog cov lus txib no, java Main.

Koj ua Kotlin li cas?

Kauj ruam 1: Tsim ib qhov project tshiab

  1. Qhib Android Studio.
  2. Nyob rau hauv Zoo siab txais tos rau Android Studio dialog, nyem Pib ib qhov tshiab Android Studio project.
  3. Xaiv qhov Kev Ua Haujlwm Yooj Yim (tsis yog lub neej ntawd).
  4. Muab koj daim ntawv thov npe xws li My First App.
  5. Xyuas kom meej tias Cov Lus tau teeb tsa rau Kotlin.
  6. Cia lub defaults rau lwm qhov chaw.
  7. Nyem Ua kom tiav.

Pom zoo: