title: Set new object equal to otherObject.method()?
body: <p>I'm learning java and come across something which confuses me quite a bit. I'm watching a video on an explanation of how http requests work...</p>
  
  <pre><code>URL theURL = new URL("http://www.google.com");
  **URLConnection theConn = theURL.openConnection();**
  </code></pre>
  
  <p>I understand the first line in that it is just creating a URL object with an actual url as an argument. But I don't understand how in the second line, a URLConnection object is being created and being set equal to a method of the other object, or is that method returning something?</p>