There are only a few things you can do in code at global scope (i.e. not inside a function/method definition). You can declare an object, as you do with allCars, and as part of that declaration you can initialise it.
But you can't have a separate assignment statement. That needs to go into a function or method.
While what you say is true, if the difference between float and double actually makes a significant difference, the problem is using floating-point representation in the first place and not the lack of extra precision that double gives (unless you're doing some high-precision scientific computing or something). For OP's purposes for ubrzanje (acceleration), I really doubt it makes a difference as to whether the number is 4.09999990 or 4.09999999 -- the more important fact is that it does not equal 4.1 (exactly), as Peter87 points out.
It's always good to know that there is a difference in precision... it's just that the more important factor to communicate is knowing that floating-point representation is fundamentally inaccurate, regardless of the exact precision.
And a bit unrelated, but things like money should never be represented as floating point for any serious application either, for this same reason (whether internally a 32-bit floating point or a 64-bit floating point).
Edit: Just to clarify, one example where it certainly can make a difference is when you have error propagation through repeated iterations. This could make one small error snowball into a bigger error. But then the difference between float and double just becomes a matter of the number of iterations until the chaos becomes unmanageable. So sure, prefer double in general (pre-optimization is the root of all evil), but the fundamental problem is still the floating point, and this should not be understated (i.e using double instead of float won't magically fix anything "in the general case").