Professional Documents
Culture Documents
Practical 14
Practical 14
import java.net.*;
import java.util.Scanner;
/*
//OUTPUT :
*/
//**************** (Practical 15) XIII(1) ********************
import java.net.*;
import java.util.Scanner;
}
}
/*
OUTPUT :
Host Name = www.msbte.org.in
Protocol = http
port number = -1
File =
*/
//******************** (Practical 15) XIII(2)
************************
import java.io.InputStream;
import java.net.*;
import java.util.Date;
if(urlc.getContentLength()!=0)
{
InputStream is = urlc.getInputStream();
while ((i=is.read())!=-1)
{
System.out.print((char)i);
}
}
else
{
System.out.println("there is no content present in this
site...!");
}
}
}
/*
OUTPUT =
Date = Mon Oct 09 22:03:02 IST 2023
Content type = text/html
Content length = 524077
Content =

<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Maharashtra State Board of Technical Education, Mumbai
, India</title>
<meta https-equiv="content-language" content="en-US">
<meta name="language" content="English">
<meta name='google-site-verification' content='Maharashtra
State Board of Technical Education, Mumbai' />
.
.
.
.
.
.
<button onclick="topFunction()" class="scrollup" id="myBtn"
title="Go to top"><img
src="https://msbte.org.in/slide/img/Maharashtra-State-Board-of-
Technical-Education--Mumbai.jpg" alt="ScrollTop"></button>
</html>
*/