Skip to main content
Improved format; grammar; layout.
Source Link

Normal

  • Val is using for static field like in Java as Static Keyword

  • Like Static in Java/ Same as in kotlin

  • And Var denotes Variable Field in Kotlin that, you can change it  .

  • Mostly Static is used when you want to save value in static memory at once,

Example  :

 if you assign

 val a=1
 a=3  UYou can not change it 
  • youYou can not change  , this is final value and Static

    var b=2

    b=4 U can change it

Normal

  • Val is using for static field like in Java as Static Keyword

  • Like Static in Java/ Same as in kotlin

  • And Var denotes Variable Field in Kotlin that, you can change it  .

  • Mostly Static is used when you want to save value in static memory at once,

Example  :

 if you assign

 val a=1
 a=3  U can not change it 
  • you can not change  , this is final value and Static

    var b=2

    b=4 U can change it

Normal

  • Val is using for static field like in Java as Static Keyword

  • Like Static in Java/ Same as in kotlin

  • And Var denotes Variable Field in Kotlin that, you can change it.

  • Mostly Static is used when you want to save value in static memory at once,

Example:

 if you assign

 val a=1
 a=3  You can not change it 
  • You can not change, this is final value and Static

    var b=2

    b=4 U can change it

Improved format
Source Link

Normal .

Val is using for static field like in Java as Static Keyword

Like Static in Java/ Same as in kotlin

&

  • Val is using for static field like in Java as Static Keyword

  • Like Static in Java/ Same as in kotlin

  • And Var denotes Variable Field in Kotlin that, you can change it .

  • Mostly Static is used when you want to save value in static memory at once,

Var denotes Variable Field in Kotlin that, you can change itExample .

Mostly Static is used when you want to save value in static memory at once,

if you assign

val a=1 a=3 U can not change it:

you can not change , this is final value and Static

 if you assign

 val a=1
 a=3  U can not change it 

var b=2 b=4 U can change it

  • you can not change , this is final value and Static

    var b=2

    b=4 U can change it

Normal .

Val is using for static field like in Java as Static Keyword

Like Static in Java/ Same as in kotlin

&

Var denotes Variable Field in Kotlin that, you can change it .

Mostly Static is used when you want to save value in static memory at once,

if you assign

val a=1 a=3 U can not change it

you can not change , this is final value and Static

var b=2 b=4 U can change it

Normal

  • Val is using for static field like in Java as Static Keyword

  • Like Static in Java/ Same as in kotlin

  • And Var denotes Variable Field in Kotlin that, you can change it .

  • Mostly Static is used when you want to save value in static memory at once,

Example :

 if you assign

 val a=1
 a=3  U can not change it 
  • you can not change , this is final value and Static

    var b=2

    b=4 U can change it

Source Link

Normal .

Val is using for static field like in Java as Static Keyword

Like Static in Java/ Same as in kotlin

&

Var denotes Variable Field in Kotlin that, you can change it .

Mostly Static is used when you want to save value in static memory at once,

if you assign

val a=1 a=3 U can not change it

you can not change , this is final value and Static

var b=2 b=4 U can change it