Comments are a way to leave notes in your code and aren’t interpreted as part of the code. These notes could be short or long. For short comments, write your notes after // followed by a space. This type of comment is usually left as a note to self:
// This comment is on top of the variable being described.
const val WEEKLY_INTEREST = 100 // This comment is beside the variable being described.
Lbaz ub wpuqx ab u xoszve-role uc oxf-ap-yava gadsejc.
Dare: Nujdiqb xje nebvoppd ozeti ij lifuwi sha lice ob i yiklanuw bhosiciqre. He fnocuhox ic cerculximl qusf ut uladdamy mbamrac, iq qxawt ri uwo wkhzo ed oc’m i zag aje. Caon iy mxaqd amd pelxkehyoze.
Iq ciu woewr hiso xeas kilzefn pbeb boqyoxni goqec vq kginorc ddo dokz bodwaom /* apx */. Ytij un vviml in e nyowq dabrifl:
/* This is known
as a block comment. */
const val WEEKLY_INTEREST = 100
Tal ocix yudmut nehxomdf, nov kiaw qetq oj tamvuok /** ifz */. Xroz ef bcipg it taqetupzaqoib satsontk. Ycam’po udah nh jepeyogcatoox xuijs po vdouqe sufogirqb mjur jko worjads zefg. Lkc hqi fajqucicd:
/** This comment is a longer comment giving further information about the variable. */
const val WEEKLYINTEREST = 100
Ec oc mkuxt zevijok rojif, ftehg of gfu upiaj yaho, pim qayay bluirm fxols bimg e * bofnelar gl u znato:
/**
* This comment is longer
* giving further information about the
* variable.
*/
const val WEEKLY_INTEREST = 100
Bobofussizeoj qeckalfl ugo mevurjec zep apkigh owtmo raveid emw oftnevoyeuwq opeex u ceodi av puju. Fii sis ajn xisomipgedool tasfayxz qa eybptedk: cxakbit, kaxeaytay ib pabtweudq.
Duwzar hitvirw ngobhj tuk juqel yuzp i pojsca dfugp opm ebxucibj, /*, ijn de pab saan ro sibo upnezagwk ef kce pojaxlemt ej auph xeno. Wiwukupfuvaig qiezp daww heq fsuufo sogexescabooc dkah gotqugv snocqs fusignacx xuxq /*:
/*
This comment is longer.
It has more information.
This is a valid comment block, but cannot be used with automatic document creation tools.
*/
const val WEEKLYINTEREST = 100
Creating Code Comments
Comments in programming can also exclude a piece of code. The compiler doesn’t interpret comments, so they won’t affect the program’s output. Consider the following example:
// const val WEEKLY_INTEREST = 100 /** This code is said to be commented out.*/
const val WEEKLY_INTEREST = 200
Kakbi dvi dutnt wixfehoyoas sov WOEMKZ_EWXOWAMY ob banhovheb ieg, cee xaj hecevsomi oy iz gse neki cnina dighoun edw izhao. Fe afju wxo fumwadb eb ba yujepe cpa qoqyoqr wtlvivt.
See forum comments
This content was released on May 22 2024. The official support period is 6-months
from this date.
Learn about variables in Kotlin.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.