-
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());
}
}
-
- com
- www
- http
- https
- 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.