I'm not sure what this is even called, so it has been very difficult to search for an answer.
I am currently learning Java and Android development and have noticed a pattern where the type of object or variable being declared is repeated multiple times and I don't understand why.
For example:
EditText editText = (EditText) findViewById(R.id.edit_message);
Why does it have to be declared a type of EditText both before and after the assignment operator '='? Why isn't once enough? Why is this necessary?
I come from a ruby background and am having trouble wrapping my head around this.