Greetings all.
Just looking for a bit of a lifeline. I am new to both Android and Java, so please excuse my green-ness
While reading through the API guides and various developer tutorials, I came across the following jargon in variable declarations:
EditText editText = (EditText) findViewById(R.id.edit_message);
so, I understand that in this we are creating a new object of type EditText called editText. Curious about the (EditText) in brackets after the = sign. What does this mean? Does this mean that we are creating a new instance? Are we only creating an empty variable, or is it simply a reference to the previously existing EditText object returned by findViewById?
How would this differe from :
EditText editText = findViewById(R.id.edit_message);
I am not looking for a lesson on Java here, but just a quick explaination of what the extra bracketed variable type is doing, and perhaps a link to a tutoral website that explains this jargon usage in more detail.
Any help is greatly appreciated.
Regards,
JUS.
Just looking for a bit of a lifeline. I am new to both Android and Java, so please excuse my green-ness
While reading through the API guides and various developer tutorials, I came across the following jargon in variable declarations:
EditText editText = (EditText) findViewById(R.id.edit_message);
so, I understand that in this we are creating a new object of type EditText called editText. Curious about the (EditText) in brackets after the = sign. What does this mean? Does this mean that we are creating a new instance? Are we only creating an empty variable, or is it simply a reference to the previously existing EditText object returned by findViewById?
How would this differe from :
EditText editText = findViewById(R.id.edit_message);
I am not looking for a lesson on Java here, but just a quick explaination of what the extra bracketed variable type is doing, and perhaps a link to a tutoral website that explains this jargon usage in more detail.
Any help is greatly appreciated.
Regards,
JUS.