We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4d2543 commit 0459de4Copy full SHA for 0459de4
Solutions/Q-07/GetIPAddress.java
@@ -9,8 +9,12 @@
9
class GetIPAddress {
10
public static void main(String[] args) throws UnknownHostException{
11
Scanner sc = new Scanner(System.in);
12
- System.out.print("Enter a valid URL of Website: ");
+ System.out.print("Enter a valid URL(including https://) of Website: ");
13
String web_url = sc.next(); // https://www.youtube.com/
14
+
15
+ // if(web_url.charAt(0) == 'H' || web_url.charAt(0) == 'h') { }
16
+ // else { web_url = "https://" + web_url; }
17
18
try {
19
InetAddress address = InetAddress.getByName(new URL(web_url).getHost());
20
String ip = address.getHostAddress();
0 commit comments