MCQOPTIONS
Saved Bookmarks
| 1. |
What is the output of this program?import java.io.*; import java.net.*; public class URL_Example{ public static void main(String[] args) { try { URL url=new URL("https://www.interviewmania.com/programming"); System.out.println("Protocol: "+url.getProtocol()); System.out.println("Host Name: "+url.getHost()); System.out.println("Port Number: "+url.getPort()); } catch(Exception e){System.out.println(e);} } } |
| A. | Protocol: https |
| B. | Host Name: www.interviewmania.com |
| C. | Port Number: -1 |
| D. | All of above |
| E. | None of these |
| Answer» E. None of these | |