Runtime declared twice: no compiler error?


experience is when everything works, but nobody knows why!

in my program i have declared Runtime twice:

Once as String and once as long.

And it worked without an error and did not even mess the two variables!


I have now corrected that mistake, but still wonder, why it worked nevertheless?.

I can see no problem with the code that you have not posted

Maybe the two variables had different scopes, for example one was global and the other was local to a function.

1065 posts, and you still think we’re psychic?

Scope? Or spelling? E.g. Runtime/runtime.


For all we know Runtime is actually an overloaded function with the String and long referred to as parameters

I am looking forward to seeing the code but my bet is on different scopes for the Runtime variable

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.