The first method would be the desired way. You can also do this, which is less code but less readable.
var a := 1
This will infer the type from the assignment, so performance wise it is the same, but can look confusing.
The second way is a cast (where you assign a variable of one type to the type of another). This would not be used for assignment. In general, casting is a bad idea if you know the type already. It is only useful in cases where you are not sure the type or are using in a statement with mixed types (for example mixing integers and floats, where you want to force the use of one or the other). It can also be used for some types of polymorphism, if you have types that are related, like base and child classes. However, even then, if you need to cast it probably means there is some design flaw in your code. But it can be useful in a bind.