<p>What if a Java allow both static and dynamic types. That might allow the best of both worlds. i.e.:</p>

<pre><code>String str = "Hello";
var temp = str;
temp = 10;
temp = temp * 5;
</code></pre>

<ol>
<li>Would that be possible?</li>
<li>Would that be beneficial?</li>
<li>Do any languages currently support both and how well does it work out?</li>
</ol>

<p>Here is a better example (generics can't be used but the program does know the type):</p>

<pre><code>var username = HttpServletRequest.getSession().getAttribute("username");//Returns a String
if(username.length() == 0) {
    //Error
}
</code></pre>

Can you explain the difference between your example and
```
```
String str = "Hello";
Object temp = str;
temp = 10;
```
```