61. What will be the output of the following Java program?
import java.net.*;
class networking
{
public static void main(String[] args) throws Exception
{
URL obj = new URL("https://www.example.com/javamcq");
URLConnection obj1 = obj.openConnection();
int len = obj1.getContentLength();
System.out.print(len);
}
}
Note: Host URL is having length of content 127.
import java.net.*;
class networking
{
public static void main(String[] args) throws Exception
{
URL obj = new URL("https://www.example.com/javamcq");
URLConnection obj1 = obj.openConnection();
int len = obj1.getContentLength();
System.out.print(len);
}
}
Note: Host URL is having length of content 127.
62. Which of these method of MimeHeader is used to return the string equivalent of the values stores on MimeHeader?
63. Which of these is an instance variable of class httpd?
64. Which of these exceptions is thrown by URL class's constructors?
65. What will be the output of the following Java program?
import java.net.*;
class networking
{
public static void main(String[] args) throws MalformedURLException
{
URL obj = new URL("https://www.example.com/javamcq");
System.out.print(obj.getHost());
}
}
import java.net.*;
class networking
{
public static void main(String[] args) throws MalformedURLException
{
URL obj = new URL("https://www.example.com/javamcq");
System.out.print(obj.getHost());
}
}
66. Which of these class must be used to send a datagram packets over a connection?
67. Which of these process occur automatically by the java runtime system?
68. What will be the output of the following Java program?
import java.net.*;
class networking
{
public static void main(String[] args) throws MalformedURLException
{
URL obj = new URL("https://www.example.com/javamcq");
System.out.print(obj.toExternalForm());
}
}
import java.net.*;
class networking
{
public static void main(String[] args) throws MalformedURLException
{
URL obj = new URL("https://www.example.com/javamcq");
System.out.print(obj.toExternalForm());
}
}
69. Which of these methods of DatagramPacket is used to find the length of byte array?
70. Which of these is a bundle of information passed between machines?
Read More Section(Java Serialization and Networking)
Each Section contains maximum 100 MCQs question on Java Serialization and Networking. To get more questions visit other sections.