Home Java URL Test using Java network programming

URL Test using Java network programming

1 min read
0
0
615

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

Employee Working Hours Calculation System using C#.net

Initialize the employee number, Hourswork,and Hoursrate to calculate a grosswage use the f…