Skip to content

Instantly share code, notes, and snippets.

@gbohra
Created February 3, 2021 06:18
Show Gist options
  • Save gbohra/e447f490dad01ba31b7314b61ffdff2e to your computer and use it in GitHub Desktop.
Save gbohra/e447f490dad01ba31b7314b61ffdff2e to your computer and use it in GitHub Desktop.
A partial code fragment is given. The URL class object is created in try block.You should write appropriate method( ) to print the protocol name and host name from the given url string.
For example:
https://www.xyz.com:1080/index.htm
protocol://host:port/filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment