Skip to content

Commit 1ade419

Browse files
author
codehouseindia
authored
Merge pull request codehouseindia#99 from NamanPatidar/patch-1
Create URlclass.java
2 parents 60de120 + d7fa069 commit 1ade419

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

URlclass.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//https://www.facebook.com/naman.patidar.104/posts/1218126358573435
2+
// subscribed code House youtube channel
3+
import java.net.*;
4+
import javax.swing.JOptionPane;
5+
6+
public class URL1 {
7+
public static void main(String args[]) {
8+
try {
9+
URL u = new URL("https://google.com");
10+
11+
System.out.println("Protocol : " + u.getProtocol());
12+
System.out.println("Host : " + u.getHost());
13+
System.out.println("Port : " + u.getPort());
14+
System.out.println("File : " + u.getFile());
15+
16+
}
17+
catch(Exception e) {
18+
JOptionPane.showMessageDialog(null , e);
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)