0% found this document useful (0 votes)
12 views

Assignment - 10 Solution

Uploaded by

imjyoti1511
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Assignment - 10 Solution

Uploaded by

imjyoti1511
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

NPTEL Online Certification Courses

Indian Institute of Technology Kharagpur

PROGRAMMING IN JAVA
Assignment10
TYPE OF QUESTION: MCQ
Number of questions: 10 Total mark: 10 × 1 = 10
______________________________________________________________________________

QUESTION 1:
Which of the following statement(s) is(are) true?

a. TCP is not reliable.


b. UDP is most reliable.
c. TCP is fast and UDP is slow.
d. In HTTPS, all communication between two computers are encrypted.

Correct Answer: d

Detailed Solution:

TCP is a reliable but slow. UDP is not reliable but comparatively fast. HTTPS is the secure
version of HTTP, where all communications between two computers are encrypted.

___________________________________________________________________________

QUESTION 2:
Which of the following statement(s) is/are true?

a. DatagramSocket implements Object.


b. DatagramSocket implements Closeable.
c. DatagramSocket extends Object.
d. DatagramSocket extends Closeable.
e. DatagramSocket extends Object implements Closeable

Correct Answer: e

Detailed Solution:

public class DatagramSocket extends Object implements Closeable is the class that represents a
socket for sending and receiving datagram packets.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

____________________________________________________________________________

QUESTION 3:
Which of the following is/are interface(s) present in java.net package?

a. InterfaceAddress
b. FileNameMap
c. DatagramPacket
d. DatagramSocket

Correct Answer: b

Detailed Solution:
FileNameMap is an interface in java.net package and the other options are classes from the
same package.

____________________________________________________________________________

QUESTION 4:
Which of the following statement(s) is/are true?

a. Addresses belongs to a Low-Level API.


b. Sockets belong to High-Level API.
c. URIs and URLs are Low-Level API.
d. Interfaces are High-Level API.

Correct Answer: a

Detailed Solution:

The java.net package can be roughly divided in two sections:

 A Low Level API, which deals with the following abstractions:


 Addresses, which are networking identifiers, like IP addresses.
 Sockets, which are basic bidirectional data communication mechanisms.
 Interfaces, which describe network interfaces.
 A High Level API, which deals with the following abstractions:
 URIs, which represent Universal Resource Identifiers.
 URLs, which represent Universal Resource Locators.
 Connections, which represents connections to the resource pointed to by URLs.

_________________________________________________________________________
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 5:
In context of the following URL, identify the correct option.

https://nptel.ac.in

a. There is no protocol provided in the above link.


b. The website provides a secure connection.
c. The given link is incomplete and hence cannot open a website.
d. The ac.in refers to the website path.

Correct Answer: b

Detailed Solution:

Resource name is nptel.ac.in. The protocol used is https and hence provides a secure connection
to the website. The link is complete in all aspects and hence can open a website (if hosted). The
ac.in portion of the website is top-level domain part and not a path.

____________________________________________________________________________
QUESTION 6:
Which of the following is/are application layer protocol(s)?

a. TCP
b. UDP
c. ARP
d. SMTP

Correct Answer: d

Detailed Solution:

TCP, UDP are transport layer protocols. ARP is a Network - IP layer protocol. SMTP is
Application layer protocol.

___________________________________________________________________________
QUESTION 7:
What is true about IP:PORT in the following options?

a. Port number 21 is the default FTP port.


b. Only port number is required for FTP connections and no IP is required.
c. 127.0.0.1 and localhost are same.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

d. There is no concept of PORT in IPv6.

Correct Answer: a, c

Detailed Solution:
Port number 21 is the default FTP port. For a FTP connection both the IP and the PORT is
required. 127.0.0.1 is the loop-back IP address of a system, which is same as localhost domain.
The concept of PORT in IPv6 is same as in IPv4 although there is some variation in the syntax.

_______________________________________________________________________
QUESTION 8:
Which of the following is/are valid Data Definition Language (DDL) command(s)?

a. SELECT
b. INSERT
c. UPDATE
d. ALTER TABLE

Correct Answer: d

Detailed Solution:
ALTER TABLE is a Data Definition Language (DDL).

_____________________________________________________________________________

QUESTION 9:
In JDBC, all raw data types (including binary documents or images) should be read and
uploaded to the database as an array of

a. byte
b. vector
c. char
d. file

Correct Answer: a

Detailed Solution:
All data types should be read and uploaded to the database as an array of bytes.

______________________________________________________________________________

QUESTION 10:
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

The package, which is required to be imported for the JDBC programming?

a. java.net
b. java.lang
c. java.io
d. java.sql

Correct Answer: d

Detailed Solution:
All classes and interfaces related to JDBC are defined in java.sql package.

____________________________________________________________

************END************

You might also like