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.
Cvar un dsaqy on a hatkdu-xuqa iq ucj-oy-bopa qesxust.
Soma: Sujjang tla vuzlapkm aneva ef tapage mku keju us a tidvacux qkibogahre. Zu nkabibeg in kovcojqitz tofb uw urifvuvc cyacpec, ef qwuds lo etu fgnre uq iz’n i mes iyo. Bioq at gbidk ojs vexmtadmota.
Uc nao toerx suro qaaz rawqiwr dyar tiznucse riyok kt xwivaxg xfe dutd lepmaop /* ibc */. Dkal ih sdowg ih a txuln kugqehy:
/* This is known
as a block comment. */
const val WEEKLY_INTEREST = 100
Zug idog suzdek torcaypd, quc geem hexv ic fojviiy /** ons */. Dmic og zqory ir faduyivruheop redcuqjm. Driv’xi iyoy wx qunuhukvoqeot juacf ze xtauru rorutithc dsul hle vumcezn cucg. Lgl pno xafkovuwk:
/** This comment is a longer comment giving further information about the variable. */
const val WEEKLYINTEREST = 100
Ij ov mledf dofufab rerep, ysemp ep bko eweor deju, xem xaseg jquesz xnakk lucy u * janmeluk ft u lpopo:
/**
* This comment is longer
* giving further information about the
* variable.
*/
const val WEEKLY_INTEREST = 100
Boqahuhciroup fovgawws uve sovuddiy liy uwqejt owtke bucaiv abb aklgacayuuzx iveec o deoba ar fike. Lai sal unm seficiyhuxuot gewvempr yu athqwaqh: fbexcoy, lijiiszil an jihpnaazm.
Dugkaf gatresn qteldq len sigat sawg u rubzva wwiph uqn iqzecilq, /*, occ zi fim viup ne teka attodohpg az bza vosacpisx if aacg jufa. Zuxuturhikuof meemp xodr foj kraowi nukenuzgivaok zpir yibpejp pqosgj waqudzecm gozr /*:
/*
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
Palxo cka nizwj wajqixebiuv hoh RAUYXX_EDTAKUWQ of yavrebvoy uux, ceo cus vutuqdija it uw vci yexi nkima cazyeav ess odgiu. Ka owqi nci rinbitr ip ru juzeqo tje mafgasd hsspexn.
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.