Skip to content

Commit 0459de4

Browse files
committed
Update GetIPAddress.java
1 parent a4d2543 commit 0459de4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Solutions/Q-07/GetIPAddress.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
class GetIPAddress {
1010
public static void main(String[] args) throws UnknownHostException{
1111
Scanner sc = new Scanner(System.in);
12-
System.out.print("Enter a valid URL of Website: ");
12+
System.out.print("Enter a valid URL(including https://) of Website: ");
1313
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+
1418
try {
1519
InetAddress address = InetAddress.getByName(new URL(web_url).getHost());
1620
String ip = address.getHostAddress();

0 commit comments

Comments
 (0)