13/11/2024, 15:28 Programming in Java - - Unit 13 - Week 10 :
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)
vinamrasrivastava112@gmail.com
NPTEL (https://swayam.gov.in/explorer?ncCode=NPTEL) » Programming in Java (course)
Course Week 10: Assignment 10
outline The due date for submitting this assignment has passed.
Due on 2024-10-02, 23:59 IST.
About
NPTEL ()
Assignment submitted on 2024-10-02, 17:32 IST
How does an 1) What will be the output of the following Java program? 1 point
NPTEL
online
course
work? ()
Week 0 : ()
Week 1 : ()
Week 2 : ()
Week 3 : ()
a. Protocol: https
Week 4 : ()
b. Host Name: nptel.ac.in
Week 5 : () c. Port Number: -1
d. All of the mentioned
Week 6 : ()
Yes, the answer is correct.
Score: 1
Week 7 : () Accepted Answers:
d. All of the mentioned
Week 8 : ()
2) What will be the output of the following Java program? 1 point
Week 9 : ()
https://onlinecourses.nptel.ac.in/noc24_cs105/unit?unit=90&assessment=442 1/4
13/11/2024, 15:28 Programming in Java - - Unit 13 - Week 10 :
Week 10 : ()
Lecture 46 :
Demonstration
-XVII (unit?
unit=90&lesso
n=91)
a. nptel
Lecture 47 : b. nptel.ac.in
Demonstration
c. www.nptel.ac.in
-XVIII (unit?
unit=90&lesso d. none of the mentioned
n=92)
Yes, the answer is correct.
Score: 1
Lecture 48 :
Networking
Accepted Answers:
b. nptel.ac.in
with Java
(unit? 3) Which class provides methods to work with URLs? 1 point
unit=90&lesso
n=93) a. URLConnection
Lecture 49 : b. HttpURL
Demonstration c. NetURL
-XIX (unit?
unit=90&lesso
d. URL
n=94) Yes, the answer is correct.
Score: 1
Lecture 50 :
Accepted Answers:
JDBC - I (unit?
d. URL
unit=90&lesso
n=95)
4) Which exception is thrown when a connection cannot be established with a remote 1 point
Feedback server?
Form (unit?
unit=90&lesso a. IOException
n=96)
b. UnknownHostException
Week 10 : c. ConnectionException
Programming
d. NetworkException
Assignment 1
(/noc24_cs105 Yes, the answer is correct.
/progassignme Score: 1
nt?name=418) Accepted Answers:
b. UnknownHostException
Week 10 :
Programming
5) Which class provides methods to create a client-side socket in Java? 1 point
Assignment 2
(/noc24_cs105
a. ServerSocket
/progassignme
nt?name=419) b. NetSocket
c. Socket
Week 10 :
Programming d. ClientSocket
Assignment 3
Yes, the answer is correct.
(/noc24_cs105 Score: 1
/progassignme
Accepted Answers:
nt?name=420)
c. Socket
https://onlinecourses.nptel.ac.in/noc24_cs105/unit?unit=90&assessment=442 2/4
13/11/2024, 15:28 Programming in Java - - Unit 13 - Week 10 :
Week 10 : 6) Which of the following statement is TRUE? 1 point
Programming
Assignment 4 a. With stream sockets there is no need to establish any connection and data flows
(/noc24_cs105 between the processes are as continuous streams.
/progassignme b. Stream sockets are said to provide a connection-less service and UDP protocol is used
nt?name=421)
c. Datagram sockets are said to provide a connection-oriented service and TCP protocol
Week 10 : is used
Programming d. With datagram sockets there is no need to establish any connection and data flows
Assignment 5
between the processes are as packets.
(/noc24_cs105
/progassignme Yes, the answer is correct.
nt?name=422) Score: 1
Accepted Answers:
Quiz: Week d. With datagram sockets there is no need to establish any connection and data flows
10:
between the processes are as packets.
Assignment
10
(assessment?
7) The server listens for a connection request from a client using which of the following 1 point
name=442) statement?
Week 10 : a. Socket s = new Socket(ServerName, port);
Assignment
b. Socket s = serverSocket.accept()
Solution (unit?
unit=90&lesso c. Socket s = serverSocket.getSocket()
n=447) d. Socket s = new Socket(ServerName);
Week 11 : () Yes, the answer is correct.
Score: 1
Accepted Answers:
Week 12 : () b. Socket s = serverSocket.accept()
Books () 8) Which of the following is/are application layer protocol(s)? 1 point
Text a. TCP
Transcripts () b. UDP
c. ARP
d. SMTP
Yes, the answer is correct.
Score: 1
Accepted Answers:
d. SMTP
9) In the following URL, identify the Resource name? 1 point
https://nptel.ac.in
a. https
b. nptel.ac.in
c. ac.in
d. nptel
Yes, the answer is correct.
S 1
https://onlinecourses.nptel.ac.in/noc24_cs105/unit?unit=90&assessment=442 3/4
13/11/2024, 15:28 Programming in Java - - Unit 13 - Week 10 :
Score: 1
Accepted Answers:
b. nptel.ac.in
10) What does this Java code snippet do? 1 point
a. Just prints the IP address of the local machine
b. Prints the IP address and host name of the local machine
c. Prints the IP address and host name of "nptel.ac.in"
d. Just prints the IP address of "nptel.ac.in"
Yes, the answer is correct.
Score: 1
Accepted Answers:
c. Prints the IP address and host name of "nptel.ac.in"
https://onlinecourses.nptel.ac.in/noc24_cs105/unit?unit=90&assessment=442 4/4