Skip to content
Advertisement

Tag: constants

How can I create and populate a constant from a file? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 months ago. Improve this question I’m making a word game program which has a dictionary of words in a text file. I need to run 2 methods through the dictionary

Is the Kotlin term “mutable” wrong?

The way I understood things is that the word “variable” referred to the capability of a reference to be reassigned. “constant” meant a reference cannot be reassigned. Essentially the difference between final or not in Java. To me “mutability” meant the ability to modify the REFERAND/OBJECT itself, not its reference. I.E. the object being referenced. But Kotlin doesn’t prevent that.

Comparison of Double Constants

I researched this a lot and I know something about precision errors in the doubles; however I couldnt find the answer. My question is: is it always safe to compare double constants? What do I mean by that is, just reading the double from a string or creating in the source code. No operation (adding, subtracting etc.) will be done

Advertisement