[J2SE] URL的openConnection和connect使用時機

看板java作者 (C++1X)時間14年前 (2011/06/18 14:11), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
java.net.URLConnection 官網文件說明 1.The connection object is created by invoking the openConnection method on a URL. 2.The setup parameters and general request properties are manipulated. 3.The actual connection to the remote object is made, using the connect method. 4.The remote object becomes available. The header fields and the contents of the remote object can be accessed. 可是我使用url.openConnection就可以開啟連線抓東西 那connect這個函式到底有何用途? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.160.113.170
文章代碼(AID): #1D_46FEh (java)