Difference between Val and const?

Val and const are immutable and read only the value assigned cann’t be reassigned later on the program.But one major difference is for Val we can pass value during run time and for const we have to mention it on compile time itself.

Example

const val companyName = "MindOrks" // this will work val comapanyname = "MindOrks" // this will work 
const val companyName = getCompanyName() // will not work val companyName = getCompanyName() // this will work