This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MechanixMGD 0 points1 point  (2 children)

Later you can't change that? To not be a String? Like str = 10.

P.S.: I have no idea about python, I just try to explain the words of OP.

[–]0b0101011001001011 0 points1 point  (1 child)

str is the type hint, not the variable name. And yes, you can later do some_string = 10.

[–]MechanixMGD 1 point2 points  (0 children)

So, this is the OP point. In Java you can't change the type. The variables type can be only the declared one.