InterviewSolution
| 1. |
How Do I Make A Connection To Url? |
|
Answer» You obtain a URL INSTANCE and then invoke openConnection on it. URLConnection is an abstract CLASS, which means you can’t directly CREATE instances of it using a constructor. We have to invoke openConnection method on a URL instance, to get the right kind of connection for your URL. Eg. URL url; URLConnection connection; You obtain a URL instance and then invoke openConnection on it. URLConnection is an abstract class, which means you can’t directly create instances of it using a constructor. We have to invoke openConnection method on a URL instance, to get the right kind of connection for your URL. Eg. URL url; URLConnection connection; |
|