• +91 9723535972
  • info@interviewmaterial.com

Kotlin Interview Questions and Answers

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

Answer -

The variable declaration with var and the variable declaration with val is used for different purposes. If you want to declare some mutable (changeable) variable, you should use var. If you want to declare the immutable variable, you should use val because val variables can't be changed once you have assigned them.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners