Professional Documents
Culture Documents
a) java.io.date
b) java.sql.date
c) java.util.date
d) java.util.dateTime
View Answer
Answer: d
Explanation: java.util.date contains both date and time. Whereas, java.sql.date contains
only date.
2. Which of the following is advantage of using JDBC connection pool?
a) Slow performance
b) Using more memory
c) Using less memory
d) Better performance
View Answer
Answer: d
Explanation: Since the JDBC connection takes time to establish. Creating connection at
the application start-up and reusing at the time of requirement, helps performance of the
application.
3. Which of the following is advantage of using PreparedStatement in Java?
a) Slow performance
b) Encourages SQL injection
c) Prevents SQL injection
d) More memory usage
View Answer
Answer: c
Explanation: PreparedStatement in Java improves performance and also prevents from
SQL injection.
4. Which one of the following contains date information?
a) java.sql.TimeStamp
b) java.sql.Time
c) java.io.Time
d) java.io.TimeStamp
View Answer
Answer: a
Explanation: java.sql.Time contains only time. Whereas, java.sql.TimeStamp contains
both time and date.
5. What does setAutoCommit(false) do?
a) commits transaction after each query
b) explicitly commits transaction
c) does not commit transaction automatically after each query
d) never commits transaction
View Answer
Answer: c
Explanation: setAutoCommit(false) does not commit transaction automatically after each
query. That saves lot of time of the execution and hence improves performance.
6. Which of the following is used to call stored procedure?
a) Statement
b) PreparedStatement
c) CallableStatment
d) CalledStatement
View Answer
Answer: c
Explanation: CallableStatement is used in JDBC to call stored procedure from Java
program.
7. Which of the following is used to limit the number of rows returned?
a) setMaxRows(int i)
b) setMinRows(int i)
c) getMaxrows(int i)
d) getMinRows(int i)
View Answer
Answer: a
Explanation: setMaxRows(int i) method is used to limit the number of rows that the
database returns from the query.
advertisement
B) ODBC drivers
C) Both A and B
A) connection.sql
B) db.sql
C) pkg.sql
D) java.sql
A) executeUpdate()
B) executeQuery()
C) execute()
D) noexecute()
A) executeUpdate()
B) executeQuery()
C) execute()
D) noexecute()
A) ResultSet
B) Parametrized
C) PreparedStatement
D) Condition
A) ResultSet
B) Parametrized
C) TableStatement
D) Condition
A) initialized
B) started
C) paused
D) stopped
A) putString()
B) insertString()
C) setString()
D) setToString()
A) putConnection()
B) setConnection()
C) Connection()
D) getConnetion()
Answers:
1. A Java program cannot directly communicate with an ODBC driver
because …….
A) ODBC written in C language
2.The JDBC-ODBC Bridge driver translates the JDBC API to the ODBC API
and used with …….
B) ODBC drivers
D) java.sql
B) executeQuery()
C) execute()
C) PreparedStatement
A) ResultSet
A) initialized
C) setString()
10. Connection object can be initialized using the ……………………….
method of the Driver Manager class.
D) getConnetion()
A. java.net.BindException occurs
33.2 When creating a client on a server port that is already in use, __________.
A. the client can connect to the server regardless of whether the port is in use
B. java.net.BindException occurs
33.3 The server listens for a connection request from a client using the following statement:
B. Socket s = serverSocket.accept()
C. Socket s = serverSocket.getSocket()
33.4 The client requests a connection to a server using the following statement:
B. Socket s = serverSocket.accept();
C. Socket s = serverSocket.getSocket();
D. Socket s = new Socket(ServerName);
A. java.net.BindException occurs
B. java.net.ConnectionException occurs
B. InputStream in = s.getInputStream();
C. InputStream in = s.obtainInputStream();
D. InputStream in = s.getStream();
33.9 You can invoke ______________ on a Socket object, say socket, to obtain an InetAddress object.
A. socket.InetAddress();
B. socket.getInetAddress();
C. socket.obtainInetAddress();
D. socket.retrieveInetAddress();
Your answer A is incorrect
The correct answer is B
33.10 The ____________ method in the InetAddress class returns the IP address.
A. getIP()
B. getIPAddress()
C. getHostAddress()
D. getAddress()
A. one
B. two
C. ten
D. an unlimited number of
A. getCodeBase().host()
B. getCodeBase().getHost()
C. getCodeBase().hostName()
D. getCodeBase().getHostName()
A. socket.getInputStream()
B. socket.getObjectStream()
C. socket.getObjectInputStream()
D. socket.objectInputStream()
E. new ObjectInputStream(socket.getInputStream());
Your answer C is incorrect
The correct answer is E
A. socket.getOutputStream()
B. socket.getObjectStream()
C. socket.getObjectOutputStream()
D. socket.objectOutputStream()
E. new ObjectOutputStream(socket.getOutputStream())
a
When creating a client on a server port that is already in use, __________.
A. the client can connect to the server regardless of whether the port is in use.
B. java.net.BindException occurs.
C. the client is blocked until the port is available.
D. the client encounters a fatal error and must be terminated.
a
The client requests a connection to a server using the following statement:
b
When a client requests connection to a server that has not yet started,
__________.
A. java.net.BindException occurs.
B. java.net.ConnectionException occurs.
C. the client is blocked until the server is started.
D. the client encounters a fatal error and must be terminated.
b
o create an InputStream on a socket s, you use __________.
c
______________ models an IP address, which can be used to find the host
name and IP address of the client.
c
The ____________ method in the InetAddress class returns the IP address.
A. getIP()
B. getIPAddress()
C. getHostAddress()
D. getAddress()
d
A ServerSocket can connect to ________ clients.
A. one
B. two
C. ten
D. an unlimited number of
b
You can obtain the server's hostname by invoking _________ on an applet.
A. getCodeBase().host()
B. getCodeBase().getHost()
C. getCodeBase().hostName()
D. getCodeBase().getHostName()
e
To obtain an ObjectOutputStream from a socket, use ________.
A. socket.getOutputStream()
B. socket.getObjectStream()
C. socket.getObjectOutputStream()
D. socket.objectOutputStream()
E. new ObjectOutputStream(socket.getOutputStream())
D
You can invoke ______________ on a Socket object, say socket, to obtain an
InetAddress object.
A. socket.obtainInetAddress();
B. socket.InetAddress();
C. socket.retrieveInetAddress();
D. socket.getInetAddress();
D
To connect to a server running on the same machine with the client, which of
the following can be used for the hostname?
A. InetAddress.getLocalHost(),
B. "127.0.0.1"
C. "localhost"
D. All of the above.
A
The server listens for a connection request from a client using the following
statement:
A. Socket s = serverSocket.accept()
B. Socket s = new Socket(ServerName);
C. Socket s = serverSocket.getSocket()
D. Socket s = new Socket(ServerName, port);
B
The server can create a server socket regardless of whether the port is in use
or not.
A. true
B. false
A
The client can connect to the server regardless of whether the port is in use or
not.
A. true
B. false
B
You cannot get instances of InputStream or OutputStream because
InputStream and OutputStream are abstract classes.
A. true
B. false
B
An applet cannot connect to a server program on a Web server where the
applet was loaded.
A. false
B. true
B
You can transmit objects over the socket.
A. false
B. true
B
getInputStream() and getOutputStream() are used to produce InputStream
and OutputStream on the socket.
A. false
B. true
A
Invoking Class.forName method may throw ___________.
A. ClassNotFoundException
B. RuntimeException
C. IOException
D. SQLException
B
In a relational data model, _________ defines the representation of the data.
A. SQL
B. Structure
C. Language
D. Integrity
A
Which of the following statements loads the JDBC-ODBC driver?
A. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
B. Class.forName(sun.jdbc.odbc.JdbcOdbcDriver)
C. Class.loadClass("sun.jdbc.odbc.JdbcOdbcDriver")
D. Class.loadClass(sun.jdbc.odbc.JdbcOdbcDriver)
A
To create a statement on a Connection object conn, use
A. Statement statement = conn.createStatement();
B. Statement statement = conn.statement();
C. Statement statement = Connection.createStatement();
D. Statement statement = connection.create();
B
22 A database URL for an access database source test is ________.
A. jdbcodbc:test
B. jdbc:odbc:test
C. test
D. sun.jdbc:odbc:test
A
Database meta data are retrieved through ____________.
A. a Connection object
B. a PreparedStatement object
C. a Statement object
D. a ResultSet Object
A
What is the return value from
stmt.executeUpdate("insert into T values (100, 'Smith')")
A. an int value indicating how many rows are effected from the invocation
B. void
C. a value indicating whether the SQL statement has been executed
successfully
D. an object that contains the status of the execution
C
A database URL for a MySQL database named test on host
panda.armstrong.edu is ________.
A. jdbc:mysql:/panda.armstrong.edu/test
B. jdbc.mysql://panda.armstrong.edu/test
C. jdbc:mysql://panda.armstrong.edu/test
D. jdbc.mysql.//panda.armstrong.edu/test
D
27 In a relational data model, _________ imposes constraints on the data.
A. Language
B. Structure
C. SQL
D. Integrity
B
To execute a SELECT statement "select * from Address" on a Statement
object stmt, use
A. stmt.executeUpdate("select * from Address");
B. stmt.executeQuery("select * from Address");
C. stmt.query("select * from Address");
D. stmt.execute("select * from Address");
A
29 _________ specify the permissible values for an attribute.
A. Domain constraints
B. intra-relational constraints
C. Primary key constraints
D. inter-relational constraints
E. Foreign key constraints
C
31 What information may be obtained from a ResultSetMetaData object?
A. number of rows in the result set
B. JDBC driver name and version
C. number of columns in the result set
D. database URL and product name
C
32 ________ is an attribute or a set of attributes that uniquely identifies the
relation.
A. A primary key
B. A key
C. A superkey
D. A candidate key
C
34 Where is com.mysql.jdbc.Driver located?
A. in the standard Java library bundled with JDK
B. in a JAR file classes12.jar
C. in a JAR file mysqljdbc.jar
B
To connect to a local MySQL database named test, use
A. Connection connection =
DriverManager.getConnection(jdbc:mysql://localhost/test);
B. Connection connection =
DriverManager.getConnection("jdbc:mysql://localhost/test");
C. Connection connection =
DriverManager.connect("jdbc:mysql://localhost/test");
D. Connection connection =
DriverManager.getConnection("mysql:jdbc://localhost/test");
D
Result set meta data are retrieved through ____________.
A. a Connection object
B. a PreparedStatement object
C. a Statement object
D. a ResultSet Object
1. import java.net.*;
2. class networking
3. {
4. public static void main(String[] args) throws
UnknownHostException
5. {
6. InetAddress obj1 =
InetAddress.getByName("sanfoundry.com");
7. InetAddress obj2 =
InetAddress.getByName("sanfoundry.com");
8. boolean x = obj1.equals(obj2);
9. System.out.print(x);
10. }
11. }
a) 0
b) 1
c) true
d) false
View Answer
Answer: c
Explanation: None.
Output:
$ javac networking.java
$ java networking
true
1. import java.net.*;
2. public class networking
3. {
4. public static void main(String[] args) throws
UnknownHostException
5. {
6. InetAddress obj1 = InetAddress.getByName("cisco.com");
7. InetAddress obj2 =
InetAddress.getByName("sanfoundry.com");
8. boolean x = obj1.equals(obj2);
9. System.out.print(x);
10. }
11. }
a) 0
b) 1
c) true
d) false
View Answer
Answer: d
Explanation: InetAddress obj1 = InetAddress.getByName(“cisco.com”); creates object
obj1 having DNS and IP address of cisco.com, InetAddress obj2 =
InetAddress.getByName(“sanfoundry.com”); creates obj2 having DNS and IP address of
sanfoundry.com, since both these address point to two different locations false is
returned by obj1.equals(obj2);.
Output:
advertisement
$ javac networking.java
$ java networking
false
1. import java.io.*;
2. import java.net.*;
3. public class URLDemo
4. {
5. public static void main(String[] args)
6. {
7. try
8. {
9. URL url=new URL("https://www.sanfoundry.com/java-mcq");
10. System.out.println("Protocol: "+url.getProtocol());
11. System.out.println("Host Name: "+url.getHost());
12. System.out.println("Port Number: "+url.getPort());
13. } catch(Exception e){System.out.println(e);}
14. }
15. }
a) Protocol: http
b) Host Name: www.sanfoundry.com
c) Port Number: -1
d) all of the mentioned
View Answer
Answer: d
Explanation: getProtocol() give protocol which is http
getUrl() give name domain name
getPort() Since we have not explicitly set the port, default value that is -1 is printed.
10. What is the output of this program?
1. import java.net.*;
2. class networking
3. {
4. public static void main(String[] args) throws
UnknownHostException
5. {
6. InetAddress obj1 = InetAddress.getByName("cisco.com");
7. System.out.print(obj1.getHostName());
8. }
9. }
a) cisco
b) cisco.com
c) www.cisco.com
d) none of the mentioned
View Answer
Answer: b
a
5) Which methods are commonly used in ServerSocket
class?
A) public OutputStream getOutputStream()
B) public Socket accept()
C) public synchronized void close()
D) None of the above
b
a
8) The java.net.InetAddress class represents an?
A) Socket
B) IP Address
C) Protocol
D) MAC Address
b
A. Domain constraints
B. Primary key constraints
C. Foreign key constraints
D. intra-relational constraints
E. inter-relational constraints
ANS: A
A. RuntimeException
B. ClassNotFoundException
C. IOException
D. SQLException
ANS: B
The statement ___________ removes the records from the table, but keeps in definition of (5
.the table in the database
ANS: D
A. Class.forName(sun.jdbc.odbc.JdbcOdbcDriver)
B. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
C. Class.loadClass(sun.jdbc.odbc.JdbcOdbcDriver)
D. Class.loadClass("sun.jdbc.odbc.JdbcOdbcDriver")
ANS:B
A. RuntimeException
B. ClassNotFoundException
C. IOException
D. SQLException
ANS:B
A. Connection
B. Statement
C. ResultSet
D. All of the above
ANS:D
A. void
B. an int value indicating how many rows are effected from the invocation
C. a value indicating whether the SQL statement has been executed successfully
D. an object that contains the status of the execution
ANS:B
ANS: A
<% A. <%= i
<% B. <%= Math.pow(2, 3)
C. <%! private long computeFactorial(int n) { if (n == 0)return 1;else return n *
<% computeFactorial(n - 1); }
<% } D. <% for (int i = 0; i <= 10; i++)
<%-- E. <!-- HTML Comment
ANS: D
<% A. <%= i
<%-- B. <%-- i
C. <%! private long computeFactorial(int n) { if (n == 0) return 1; else return n *
<% computeFactorial(n - 1); }
<% } D. <% for (int i = 0; i <= 10; i++)
<-- E. <!-- HTML Comment
ANS: B
A. request
B. response
C. out
D. session
E. All of the above
ANS: E
<% A. <%= i
<% B. <%= Math.pow(2, 3)
<% ()C. <%= new Date().toString
<% } D. <% for (int i = 0; i <= 10; i++)
E. A,B,and C
ANS: E
<% A. <%= i
<% B. <%= Math.pow(2, 3)
C. <%! private long computeFactorial(int n) { if (n == 0) return 1; else return n *
<% computeFactorial(n - 1); }
<% } D. <% for (int i = 0; i <= 10; i++)
<-- E. <!-- HTML Comment
ANS:C
The ________ directive lets you provide information for the page, such as importing (8
classes and setting up content type. The page directive can appear anywhere in
A. page
B. include
C. tablib
D. import
ANS: A
ANS: D
()A. response.getOutputStream
()B. response.getWriter
()C. request.getOutputStream
()D. request.getWriter
E. application
ANS : B
34.1 In a relational data model, _________ defines the representation of the data.
A. Structure
B. Integrity
C. Language
D. SQL
A. Structure
B. Integrity
C. Language
D. SQL
A. Structure
B. Integrity
C. Language
D. SQL
A. Domain constraints
D. intra-relational constraints
E. inter-relational constraints
34.6 ________ is an attribute or a set of attributes that uniquely identifies the relation.
A. A superkey
B. A key
C. A candidate key
D. A primary key
Your answer is correct
34.8 To retrieve all courses with more than 3 credit hours, you write
A. Yes
B. No
A. Class.forName(sun.jdbc.odbc.JdbcOdbcDriver)
B. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
C. Class.loadClass(sun.jdbc.odbc.JdbcOdbcDriver)
D. Class.loadClass("sun.jdbc.odbc.JdbcOdbcDriver")
A. RuntimeException
B. ClassNotFoundException
C. IOException
D. SQLException
A. test
B. jdbcodbc:test
C. jdbc:odbc:test
D. sun.jdbc:odbc:test
34.13 A database URL for a MySQL database named test on host panda.armstrong.edu is ________.
A. jdbc.mysql.//panda.armstrong.edu/test
B. jdbc:mysql:/panda.armstrong.edu/test
C. jdbc:mysql://panda.armstrong.edu/test
D. jdbc.mysql://panda.armstrong.edu/test
34.16 To execute a SELECT statement "select * from Address" on a Statement object stmt, use
A. stmt.execute("select * from Address");
A. void
B. an int value indicating how many rows are effected from the invocation
C. a value indicating whether the SQL statement has been executed successfully
A. preparedStatement.setString(0, "John");
B. preparedStatement.setString(1, "John");
C. preparedStatement.setString(0, 'John');
D. preparedStatement.setString(1, 'John');
A. preparedStatement.execute();
B. preparedStatement.executeUpdate();
C. preparedStatement.executeQuery();
D. preparedStatement.query();
Assume that the first parameter is an IN parameter with value John. To set t
his parameter value, use
A. callableStatement.setString(0, "John");
B. callableStatement.setString(1, "John");
C. callableStatement.setString(0, 'John');
D. callableStatement.setString(1, 'John');
Assume that the second parameter is an OUT parameter with value John. To reg
ister this parameter, use
A. callableStatement.registerOutParameter(0, java.sql.Types.STRING);
B. callableStatement.registerOutParameter(1, java.sql.Types.STRING);
C. callableStatement.registerOutParameter(2, java.sql.Types.STRING);
A. a Connection object
B. a Statement object
C. a ResultSet Object
D. a PreparedStatement object
transfers mail
message header must have a properly formatted recipient email address and a sender uses
port 25 Post Office Protocol (POP)
mail is downloaded from the server to the client and then deleted on the server uses port
110
POP3 is desirable for an ISP, because it alleviates their responsibility for managing large
amounts of storage for their email servers
DHCP server is contacted and address requested - chooses address from a configured range
of addresses called a pool and “leases” it to the host for a set period. DHCP used for general
purpose hosts such as end user devices, and static addressing is used for network devices
such as gateways, switches, servers and printers.
After the connection is established, the user can access the resources on the server as if the
resource is local to the client host.
Domain Name System (DNS): TCP/UDP Port 53
Hypertext Transfer Protocol (HTTP) : TCP Port 80 Simple Mail Transfer Protocol (SMTP) : TCP
Port 25
Gnutella is a P2P file sharing application. Since this is a P2P application, there is no client
and server software. All of them are called peers. With Gnutella, people can make files on
their hard disks available for others to download.
Telnet allows users to remotely access another device (host, router, switch).
In the Internet, all end devices have an IP address to enable it to send and receive data over
the network.
Since it is easier to remember names instead of numbers, an end device is also normally
given a domain name.
Domain Name System (DNS) is a service used to convert domain name to IP address.
MCQ
36 Multiple object can be sent over a TCP connection between client and server in
.
a. persistent HTTP
b. nonpersistent HTTP
a. application layer
b. transport layer
c. network layer
a. HTTP, FTP
b. HTTP, TELNET
c. FTP, SMTP
d. HTTP, SMTP
(i) HTTP
(ii) FTP
(iii) TCP
(iv) POP3
d. (iv) only
View Answer Report Discuss Too Difficult! Search Google
3. Which of the following is the Application layer protocol in Internet Protocol Suite?
a. SSH
b. XMPP
c. IMAP
a. Routing
b. Routed
c. Communication
d. Process-to-process
Answer: (c).Communication
1.DHCP
2.FTP
3.RSVP
4.NNTP
a. Only 1
b. Only 2
c. Only 3
d. 1, 2 and 4
6. Identify the correct order in which the following actions take place in an interactio
web browser and a web server.
2. The web browser establishes a TCP connection with the web server.
a. 4,2,1,3
b. 1,2,3,4
c. 4,1,2,3
2,4,1,3
d.
Answer: (a).4,2,1,3
d. None
c. rules for when and how processes send and respond to messages
12. Which one of the following protocol delivers/stores mail to receiver server?
a. base 64 encoding
b. base 32 encoding
c. base 16 encoding
d. base 8 encoding
15. Which protocol is a signalling communication protocol used for controlling multime
communication sessions?
a. application layer protocols are used by both source and destination devices during a communication session
b. application layer protocols implemented on the source and destination host must match
17. When displaying a web page, the application layer uses the
a. HTTP protocol
b. FTP protocol
c. SMTP protocol
a. HTTP
b. SMTP
c. FTP
d. TCP
Answer: (d).TCP
a. Packet
b. Message
c. Segment
d. Frame
Answer: (b).Message
a. SMTP
b. HTTP
c. FTP
d. SIP
Answer: (a).SMTP
65. Simple mail transfer protocol (SMTP) utilizes ____ as the transport layer protocol fo
mail transfer.
a. TCP
b. UDP
c. DCCP
d. SCTP
Answer: (a).TCP
a. SMTPS
b. SSMTP
c. SNMP
Answer: (a).SMTPS
a. 22
b. 23
c. 24
d. 25
Answer: (d).25
68. Which one of the following protocol is used to receive mail messages?
a. SMTP
b. an SMTP extension
70. An email client needs to know the ____ of its initial SMTP server.
a. IP address
b. MAC address
c. url
a. 1
b. 2
c. 3
d. 4
Answer: (b).2
a. 20
b. 21
c. 22
d. 23
Answer: (b).21
42. In FTP, client contacts server using ____ as the transport protocol.
a. 25
b. 80
c. 21
d. 65
47 The ______ method when used in the method field, leaves entity body empty.
.
a. POST
b. GET
Answer: (b).GET
1. Transport layer aggregates data from different applications into a single stream before
passing it to
a) network layer
b) data link layer
c) application layer
d) physical layer
View Answer
Answer: a
Explanation: None.
2. Which one of the following is a transport layer protocol used in internet?
a) TCP
b) UDP
c) Both (a) and (b)
d) None of the mentioned
View Answer
Answer: c
Explanation: None.
3. User datagram protocol is called connectionless because
a) all UDP packets are treated independently by transport layer
b) it sends data as a stream of related packets
c) both (a) and (b)
d) none of the mentioned
View Answer
Answer: a
Explanation: None.
4. Transmission control protocol is
a) connection oriented protocol
b) uses a three way handshake to establish a connection
c) recievs data from application as a single stream
d) all of the mentioned
View Answer
Answer: d
Explanation: None.
5. An endpoint of an inter-process communication flow across a computer network is called
a) socket
b) pipe
c) port
d) none of the mentioned
View Answer
Answer: a
Explanation: None.
6. Socket-style API for windows is called
a) wsock
b) winsock
c) wins
d) none of the mentioned
View Answer
Answer: b
Explanation: None.
7. Which one of the following is a version of UDP with congestion control?
a) datagram congestion control protocol
b) stream control transmission protocol
c) structured stream transport
d) none of the mentioned
View Answer
Answer: a
Explanation: None.
8. A _____ is a TCP name for a transport service access point.
a) port
b) pipe
c) node
d) none of the mentioned
View Answer
Answer: a
Explanation: None.
9. Transport layer protocols deals with
a) application to application communication
b) process to process communication
c) node to node communication
d) none of the mentioned
View Answer
Answer: b
Explanation: None.
10. Which one of the following is a transport layer protocol?
a) stream control transmission protocol
b) internet control message protocol
c) neighbor discovery protocol
d) dynamic host configuration protocol
View Answer
Answer: a
Explanation: None.
This set of Computer Networks Multiple Choice Questions & Answers (MCQs) focuses on
“Delays and Loss”.
1. Which of the following delay is faced by the packet in travelling from one end system to
another ?
a) Propagation delay
b) Queuing delay
c) Transmission delay
d) All of the mentioned
View Answer
Answer: d
Explanation: None.
2. For a 10Mbps Ethernet link, if the length of the packet is 32bits, the transmission delay
is(in milliseconds)
a) 3.2
b) 32
c) 0.32
d) None of the mentioned
View Answer
Answer: a
Explanation: Transmission rate = length / transmission rate = 32/10 = 3.2milli seconds.
3. The time required to examine the packet’s header and determine where to direct the
packet is part of
a) Processing delay
b) Queuing delay
c) Transmission delay
d) All of the mentioned
View Answer
Answer: a
Explanation: None.
4. Traffic intensity is given by, where L = number of bits in the packet a = average rate R
= transmission rate
a) La/R
b) LR/a
c) R/La
d) None of the mentioned
View Answer
Answer: a
Explanation: None.
5. In the transfer of file between server and client, if the transmission rates along the path
is 10Mbps, 20Mbps, 30Mbps, 40Mbps. The throughput is usually
a) 20Mbps
b) 10Mbps
c) 40Mbps
d) 50Mbps
View Answer
Answer: b
Explanation: The throughput is generally the transmission rate of bottleneck link.
6. If end to end delay is given by dend-end = N(dproc + dtrans + dprop) is a non
congested network. The number of routers between source and destination is
a) N/2
b) N
c) N-1
d) 2N
View Answer
Answer: c
Explanation: None.
7. The total nodal delay is given by
a) dnodal = dproc – dqueue + dtrans + dprop
b) dnodal = dproc + dtrans – dqueue
c) dnodal = dproc + dqueue + dtrans + dprop
d) dnodal = dproc + dqueue – dtrans – dprop
View Answer
Answer: c
Explanation: None.
8. In a network, If P is the only packet being transmitted and there was no earlier
transmission, which of the following delays could be zero
a) Propogation delay
b) Queuing delay
c) Transmission delay
d) Processing delay
View Answer
Answer: b
Explanation: None.
9. Transmission delay does not depend on
a) Packet length
b) Distance between the routers
c) Transmission rate
d) None of the mentioned
View Answer
Answer: b
Explanation: Transmission delay = packet length / transmission rate
10. Propagation delay depends on
a) Packet length
b) Transmission rate
c) Distance between the routers
d) None of the mentioned
View Answer
Answer: c
Explanation: Propagation delay is the time it takes a bit to propagate from one router to
the next.
1. Which is not a application layer protocol?
a) HTTP
b) SMTP
c) FTP
d) TCP
View Answer
Answer: d
Explanation: TCP is transport layer protocol.
2. The packet of information at the application layer is called __________
a) Packet
b) Message
c) Segment
d) Frame
View Answer
Answer: b
Explanation: For Application, Presentation and Session layers there is no data format for
message. Message is message as such in these three layers. But when it comes to
Transport, Network, Data and Physical layer they have data in format of segments,
packets, frames and bits respectively.
3. Which one of the following is an architecture paradigms?
a) Peer to peer
b) Client-server
c) HTTP
d) Both Peer-to-Peer & Client-Server
View Answer
Answer: d
Explanation: HTTP is a protocol.
4. Application developer has permission to decide the following on transport layer side
a) Transport layer protocol
b) Maximum buffer size
c) Both Transport layer protocol and Maximum buffer size
d) None of the mentioned
View Answer
Answer: c
Explanation: Application layer provides the interface between applications and the
network. So application developer can decide what transport layer to use and what
should be its maximum buffer size.
5. Application layer offers _______ service.
a) End to end
b) Process to process
c) Both End to end and Process to process
d) None of the mentioned
View Answer
Answer: a
Explanation: End to End service is provided in the application layer. Whereas process to
process service is provided at the transport layer.
6. E-mail is _________
a) Loss-tolerant application
b) Bandwidth-sensitive application
c) Elastic application
d) None of the mentioned
View Answer
Answer: c
Explanation: Because it can work with available throughput.
7. Pick the odd one out.
a) File transfer
b) File download
c) E-mail
d) Interactive games
View Answer
Answer: d
Explanation: File transfer, File download and Email are services provided by the
application layer and there are message and data oriented.
8. Which of the following is an application layer service?
a) Network virtual terminal
b) File transfer, access, and management
c) Mail service
d) All of the mentioned
View Answer
Answer: d
Explanation: The services provided by the application layer are network virtual terminal,
file transfer, access and management, mail services, directory services, various file and
data operations.
9. To deliver a message to the correct application program running on a host, the
_______ address must be consulted.
a) IP
b) MAC
c) Port
d) None of the mentioned
View Answer
Answer: c
Explanation: IP address lets you know where the network is located. Whereas MAC
address is a unique address for every device. Port address identifies a process or service
you want to carry on.
10. Which is a time-sensitive service?
a) File transfer
b) File download
c) E-mail
d) Internet telephony
View Answer
Answer: d
Explanation: Internet telephony is Loss-tolerant other applications are not
1. Transport layer aggregates data from different applications into a single stream before
passing it to
a) network layer
b) data link layer
c) application layer
d) physical layer
View Answer
Answer: a
Explanation: The flow of data in the OSI model flows in following manner Application ->
Presentation -> Session -> Transport -> Network -> Data Link -> Physical.
2. Which one of the following is a transport layer protocol used in networking?
a) TCP
b) UDP
c) Both TCP and UDP
d) None of the mentioned
View Answer
Answer: c
Explanation: Both TCP and UDP are transport layer protocol in networking. TCP is an
abbreviation for Transmission Control Protocol and UDP is an abbreviation for User
Datagram Protocol. TCP is connection oriented whereas UDP is connectionless.
3. User datagram protocol is called connectionless because
a) all UDP packets are treated independently by transport layer
b) it sends data as a stream of related packets
c) it is received in the same order as sent order
d) none of the mentioned
View Answer
Answer: a
Explanation: UDP is an alternative for TCP and it is used for those purposes where
speed matters most whereas loss of data is not a problem. UDP is connectionless
whereas TCP is connection oriented.
4. Transmission control protocol is
a) connection oriented protocol
b) uses a three way handshake to establish a connection
c) recievs data from application as a single stream
d) all of the mentioned
View Answer
Answer: d
Explanation: Major internet applications like www, email, file transfer etc rely on tcp. TCP
is connection oriented and it is optimized for accurate delivery rather than timely delivery.
It can incur long delays.
5. An endpoint of an inter-process communication flow across a computer network is
called
a) socket
b) pipe
c) port
d) none of the mentioned
View Answer
Answer: a
Explanation: Socket is one end point in a two way communication link in the network.
TCP layer can identify the application that data is destined to be sent by using the port
number that is bound to socket.
6. Socket-style API for windows is called
a) wsock
b) winsock
c) wins
d) none of the mentioned
View Answer
Answer: b
Explanation: Winsock is a programming interface which deals with input output requests
for internet applications in windows OS. It defines how windows network software should
access network services.
7. Which one of the following is a version of UDP with congestion control?
a) datagram congestion control protocol
b) stream control transmission protocol
c) structured stream transport
d) none of the mentioned
View Answer
Answer: a
Explanation: The datagram congestion control is a transport layer protocol which deals
with reliable connection setup, teardown, congestion control, explicit congestion
notification, feature negotiation.
8. A _____ is a TCP name for a transport service access point.
a) port
b) pipe
c) node
d) none of the mentioned
View Answer
Answer: a
Explanation: Just as the IP address identifies the computer, the network port identifies
the application or service running on the computer. A port number is 16 bits.
9. Transport layer protocols deals with
a) application to application communication
b) process to process communication
c) node to node communication
d) none of the mentioned
View Answer
Answer: b
Explanation: Transport layer is 4th layer in TCP/IP model and OSI reference model. It
deals with logical communication between process. It is responsible for delivering a
message between network host.
10. Which one of the following is a transport layer protocol?
a) stream control transmission protocol
b) internet control message protocol
c) neighbor discovery protocol
d) dynamic host configuration protocol
View Answer
Answer: a
Explanation: There are many protocols in transport layer. The most prominent are TCP
and UDP. Some of the other protocols are RDP, RUDP, SCTP, DCCP etc.
1. Which page directive should be used in JSP to generate a PDF page?
a) contentType
b) generatePdf
c) typePDF
d) contentPDF
View Answer
2. Which tag should be used to pass information from JSP to included JSP?
a) Using <%jsp:page> tag
b) Using <%jsp:param> tag
c) Using <%jsp:import> tag
d) Using <%jsp:useBean> tag
View Answer
Answer: a
Explanation: <%jsp:param> tag is used to pass information from JSP to included JSP.
3. Application is instance of which class?
a) javax.servlet.Application
b) javax.servlet.HttpContext
c) javax.servlet.Context
d) javax.servlet.ServletContext
View Answer
Answer: d
Explanation: Application object is wrapper around the ServletContext object and it is an
instance of a javax.servlet.ServletContext object.
4. _jspService() method of HttpJspPage class should not be overridden.
a) True
b) False
View Answer
Answer: a
Explanation: _jspService() method is created by JSP container. Hence, it should not be
overridden.
5. Which option is true about session scope?
a) Objects are accessible only from the page in which they are created
b) Objects are accessible only from the pages which are in same session
c) Objects are accessible only from the pages which are processing the same request
d) Objects are accessible only from the pages which reside in same application
View Answer
6. Default value of autoFlush attribute is?
a) true
b) false
View Answer
Answer: a
Explanation: Default value “true” depicts automatic buffer flushing.
7. Which one is the correct order of phases in JSP life cycle?
a) Initialization, Cleanup, Compilation, Execution
b) Initialization, Compilation, Cleanup, Execution
c) Compilation, Initialization, Execution, Cleanup
d) Cleanup, Compilation, Initialization, Execution
View Answer
Answer: c
Explanation: The correct order is Compilation, Initialization, Execution, Cleanup.
advertisement