Understanding Java syntax of GridView gridview = (GridView) findViewById(R.id.gridview);
<p>In the android tutorials, The <a href="http://developer.android.com/resources/tutorials/views/hello-gridview.html" rel="nofollow">GridView tutorial</a> to be exact, there is a line of code</p>

<pre><code>GridView gridview = (GridView) findViewById(R.id.gridview);
</code></pre>

<p>Which looks to be declaring/instantiating a GridView object named, gridview and assigning from ...
(GridView) </p>

<p>Now is the (GridView) in parens, the expected return type of findViewById or is it telling where to find <code>findViewById</code> since that doesn't appear to be connected to an object (although, it would appear to be a member function of a GridView object)??</p>

<p>I believe that the <a href="http://developer.android.com/reference/android/app/Activity.html#findViewById%28int%29" rel="nofollow">findViewById</a> returns an object of type GridView specified by the resource  id of gridview (that we specied in main.xml) and probably now exists after we, earlier, called <code>setContentView(R.layout.main);</code></p>

<p>So, what is being specified with the <code>(GridView)</code> part of the syntax and what is specifically meant by the parenthesis?</p>
