• +91 9723535972
  • info@interviewmaterial.com

Kotlin Interview Questions and Answers

Question - What is the difference between the variable declaration with val and variable declaration with const?

Answer -

Both the variables that are declared with val and const are immutable in nature. But the difference between the variable declaration with val and variable declaration with const is that the value of the const variable must be known at the compile-time. In contrast, the value of the val variable can be assigned at runtime also.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners