I would like to know if there is a way to do something like this in Java:

```
Integer a = new Integer(2);
a.getClass() newVariable = new Integer(4);

```

My question is can I declare the type of a new variable by using a variable?