Home » JAVA Programming » Networking » Question
  1. What is the output of this program?
     import java.net.*;
    public class Networking_Protocol
    {
    public static void main(String[] args) throws MalformedURLException
    {
    URL object = new URL("https://www.interviewmania.com/programming");
    System.out.print(object.getProtocol());
    }
    }
    1. com
    2. www
    3. http
    4. https
    5. None of these
Correct Option: D

object.getProtocol() is used to know the protocol used by the host. http stands for hypertext transfer protocol, usually 2 types of protocols are used http and https, where s in https stands for secured.



Your comments will be displayed only after manual approval.