Shri Siddheshwar Devsthan Trust's
Shri Siddheshwar Women's Polytechnic, Solapur.
Academic Year 2024-25
Weekly Test - IV Model Answer
Course Name: IF Semester: Fifth Roll No. Sign of Student
Subject Title :AJP Marks:30
Subject Code:22517 Time: 1 Hour Total Marks: Name & Sign of Examiner
Date:19 Oct. 2024 Duration: 1 Hour
Sr. Correct
No. Questions Option A Option B Option C Option D Marks
Option
How many bits are in an IPv4
1 8 bits 16 bits 32 bits 64 bits C
address?
Network programming in any IP addresses;
user names; IP addresses;
2 language definitely needs to deal with link-layer None C
port numbers port numbers
______ and ______. address
In Java, an IP address is defined as an
3 InetAddress SocketAddress IPAddress None A
object, the instance of _______ class.
We can use
To create IPv4 To create IPv6
InetAddress
address we address we
In Java, which of the following class to create
4 must use must use None C
statement is true? both IPv4 and
Inet4Address Inet6Address
IPv6
class. class.
addresses.
A port number in Java is defined as a 24-bit
5 a 16-bit integer a 48-bit integer None B
________________ integer. integer
The class used in Java network
InetSocketAddr
6 programming for socket address is the InetAddress SocketAddress None C
ess
______________ class.
A server in a client-server paradigm
asynchronous; iterative; simultaneous;
7 can be designed either as an_____ None B
concurrent concurrent intermittent
server or a _________ server.
only two
several clients
A concurrent server can server one client at a clients
8 simultaneously None C
___________. time simultaneousl
y
In Java two methods,
9 getOutputStream and getInputStream, ServerSocket Socket Stream None B
are provided in the ________ class.
_______________ is responsible for
10 Socket ServerSocket ClientSocket None C
establishing a connection. C option corrected
ServerSocket is sometimes called the passive socket; active socket; waiting socket;
11 None A
________ and or the ______ socket. listen socket listen socket listen socket
Domain Domain
Data Netwok Data Name
12 Which of these is a full form of DNS? Network Name D
Service Service
Service Service
Which of these class is used to DatagramPack ContentHand
13 URL InetAddress C
encapsulate IP address and DNS? et ler
Which of these protocol for breaking
14 and sending packets to an address TCP/IP DNS Socket Proxy Server A
across a network?
Which of these package contains
15 java.io java.util java.net java.network C
classes and interfaces for networking?
Which Java package is primarily used
16 java.net java.io java.util java.swing A
for networking?
Which class is used to create a server
17 Socket ServerSocket NetSocket HostSocket B
socket?
Which method is used to read data
18 readData() pullData() fetch() read() D
from an InputStream object?
What does the InetAddress class Domain IPAd Dom
19 URL IPAddress Host Name B
represent? Name dress ain
Nam
Which protocol ensures error-free
20 HTTP UDP FTP TCP D
data transmission?
How many ports of TCP/IP reserved
21 10 1024 2048 512 B
for specific protocols?
only one type
Java implementation of UDP uses two types of many types of
22 of socket None A
___________ socket objects socket objects
objects
DatagramSock A
The ________________ class is used to DatagramPack DatagramSock et or correct
23 None C wrong
create datagram packets. et et DatagramPack answe
et r
Java implementation of TCP uses
24 only one only two Many types None B
_______________ types of socket objects.
ClientSocket Socket object;
In Java implementation of TCP, a client Socket object;
object; ServerSocket
25 uses _________; a server uses ServerSocket None C
ServerSocket object and
__________. objec
object Socket object
in both the
in the UDP in the UDP
26 The DagramSocket class is used to UDP client and None C
client server
create sockets ________________. UDP server
How many ports of TCP/IP are
27 10 1024 2048 512 B
reserved for specific protocols?
What will be the output of the following Java
program? 1.import java.net.*;
2. class networking
3. {
4. public static void main(String[] args)
throws UnknownHostException
5. {
6. InetAddress obj1
28 =InetAddress.getByName("sanfoundry.com");
0 1 true false C
7. InetAddress obj2 =
InetAddress.getByName("sanfoundry.com");
8. boolean x = obj1.equals(obj2);
9. System.out.print(x);
10. }
11. }
What will be the output of the following Java
program11
1.import java.net.*;
2. public class networking
3. {
4. public static void main(String[] args)
throws UnknownHostException
5. {
29 6. InetAddress obj1 =
0 1 true false D
InetAddress.getByName("cisco.com");
7. InetAddress obj2 =
InetAddress.getByName("sanfoundry.com");
8. boolean x = obj1.equals(obj2);
9. System.out.print(x);
10. }
11. }
What will be the output of the following Java
program?
1. import java.net.*;
2. class networking
3. {
4. public static void main(String[] args)
30 throws UnknownHostException cisco cisco.com None B
5. { www.cisco.com
6. InetAddress obj1 =
InetAddress.getByName("cisco.com");
7. System.out.print(obj1.getHostName());
8. }
9. }