Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #22377

Re: HttpURLConnection

X-Received by 10.68.196.134 with SMTP id im6mr2055720pbc.5.1361313063048; Tue, 19 Feb 2013 14:31:03 -0800 (PST)
X-Received by 10.50.217.225 with SMTP id pb1mr2511094igc.5.1361313063002; Tue, 19 Feb 2013 14:31:03 -0800 (PST)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!su1no905511pbb.0!news-out.google.com!jm3ni9718pbb.0!nntp.google.com!su1no905502pbb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Tue, 19 Feb 2013 14:31:02 -0800 (PST)
In-Reply-To <30772112-527f-47b0-9333-70777b889b5c@googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
NNTP-Posting-Host 69.28.149.29
References <30772112-527f-47b0-9333-70777b889b5c@googlegroups.com>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <a4077e75-4640-44be-a415-44fbf0fa5f48@googlegroups.com> (permalink)
Subject Re: HttpURLConnection
From Lew <lewbloch@gmail.com>
Injection-Date Tue, 19 Feb 2013 22:31:03 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.java.programmer:22377

Show key headers only | View raw


On Tuesday, February 19, 2013 1:45:25 PM UTC-8, bob smith wrote:
> How can people use the class HttpURLConnection when the abstract method connect()
> from URLConnection is never defined?

False.

> I thought you can't use a class till all the abstract blanks are filled in?

True.

Look up polymorphism and widening conversions.

http://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.1.5

Understand the difference between declared type (compile time) and run-time type.

Read the Java tutorials.

Did you know that any object of a given type is also an object of every supertype of its type?

That's how you can get 

List<Foo> foos = new ArrayList<>();

'List', being an interface, has only abstract instance methods. Yet somehow you can call 

foos.add(new Foo());

Same thing.

This is basic Java stuff. Heck, it's basic O-O stuff. Google around for some introductory texts.

-- 
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

HttpURLConnection bob smith <bob@coolfone.comze.com> - 2013-02-19 13:45 -0800
  Re: HttpURLConnection Lew <lewbloch@gmail.com> - 2013-02-19 14:31 -0800
  Re: HttpURLConnection Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-02-19 17:56 -0500
    Re: HttpURLConnection bob smith <bob@coolfone.comze.com> - 2013-02-20 10:26 -0800
      Re: HttpURLConnection Arne Vajhøj <arne@vajhoej.dk> - 2013-02-22 13:28 -0500
  Re: HttpURLConnection Roedy Green <see_website@mindprod.com.invalid> - 2013-02-20 22:05 -0800

csiph-web