Home Java URL Test using Java network programming

URL Test using Java network programming

1 min read
0
0
609

This tutorial will teach you how to test Url.defined in the URL class to retrieve information about the URL.

public class URLTest {

  
    public static void main(String[] args) 
    {
       URL obj;
        try {
            obj = new URL("https://www.tutussfunny.com");
            System.out.println("Protocal : " + obj.getProtocol() );
            System.out.println("host : " + obj.getHost() ); 
            System.out.println("Port : " + obj.getPort()); 
        } catch (MalformedURLException ex) {
            Logger.getLogger(URLTest.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

I have attached the video tutorial below it will help you  to do this  step by step.

 

Load More Related Articles
Load More By admin
Load More In Java

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

Creating a Calculator in WPF with C# – Step-by-Step Tutorial

In this tutorials will teach how to make a calculator using wpf C# application step by ste…