0

programming languages Online Quiz - 281

Description: programming languages Online Quiz - 281
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

To show money format on the JSP page we use __________ class

  1. AirthmaticFormat

  2. CurrencyFormat

  3. NumberFormat ==

  4. StringBuffer


Correct Option: C

The information needed to create a TCP socket for communication in JSP is

  1. The Local Systems IP Address

  2. Local Systems Port Number

  3. Remote System’s IPAddress

  4. All of the above


Correct Option: D

Following methods can be overridden in the JSP page

  1. jspDestroy()

  2. jspInit()==

  3. _jspService()

  4. getParameter()


Correct Option: A

Which of the statement below does not correctly defines the difference between JDBC and ODBC ?

  1. ODBC can be directly used with Java because it uses a C interface

  2. ODBC makes uses of pointers which has been totally removed from JAVA

  3. ODBC is from Microsoft while JDBC is from java applications

  4. ODBC requires manual installation of the ODBC driver manager and driver on all client machines. While for JDBC driver are written in Java and JDBC code is automatically installable, secure and portable on all platforms.


Correct Option: A

AI Explanation

To answer this question, you need to understand the differences between JDBC and ODBC.

Let's go through each option to understand why it is correct or incorrect:

Option A) ODBC can be directly used with Java because it uses a C interface - This option is incorrect because ODBC cannot be directly used with Java. ODBC uses a C interface, which means that to use ODBC with Java, a bridge or translator is required to convert the ODBC calls to Java calls. JDBC, on the other hand, is a native Java API and can be directly used with Java applications.

Option B) ODBC makes use of pointers which has been totally removed from JAVA - This option is incorrect because ODBC does not make use of pointers. Pointers are a concept in C and C++ programming languages, and Java does not support pointers. JDBC, being a native Java API, does not use pointers either.

Option C) ODBC is from Microsoft while JDBC is from Java applications - This option is incorrect because ODBC is not from Microsoft. ODBC stands for Open Database Connectivity, and it is a standard API that allows applications to access data in different database systems. JDBC, on the other hand, is a Java API that provides a standard way to interact with databases in Java applications.

Option D) ODBC requires manual installation of the ODBC driver manager and driver on all client machines. While for JDBC, drivers are written in Java and JDBC code is automatically installable, secure, and portable on all platforms - This option is correct. ODBC requires manual installation of the ODBC driver manager and driver on all client machines. In contrast, JDBC drivers are written in Java, and JDBC code is automatically installable, secure, and portable on all platforms.

The correct answer is A. This option does not correctly define the difference between JDBC and ODBC because ODBC cannot be directly used with Java due to its C interface.

Which of the following statements is true about JSP tag library?

  1. It defines the standard tag that works the same everywhere

  2. It is a single library and we can use it in multiple jsp containers

  3. It has support for the common structural tasks like iteration and condition

  4. All of the above


Correct Option: D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) It defines the standard tag that works the same everywhere - This option is incorrect. JSP tag libraries do not define standard tags that work the same everywhere. Instead, they provide a way to create custom tags that can be used in JSP pages.

Option B) It is a single library and we can use it in multiple JSP containers - This option is incorrect. JSP tag libraries are not a single library that can be used in multiple JSP containers. Each JSP container may have its own set of supported tag libraries.

Option C) It has support for the common structural tasks like iteration and condition - This option is correct. JSP tag libraries often provide support for common structural tasks like iteration (looping through a collection of items) and condition (performing conditional checks).

Option D) All of the above - This option is correct. The statement "All of the above" is true because JSP tag libraries do provide support for common structural tasks, and while they may not define standard tags that work the same everywhere, they can be used in multiple JSP containers depending on their compatibility.

Therefore, the correct answer is option D) All of the above.

Java Server Pages specification includes

  1. Script language declarations, scriplets and expressions.

  2. JSP standard actions

  3. JSP standard directives

  4. All the Above


Correct Option: D

Which of the tag contains a code fragment valid in the page scripting language


Correct Option: B

The _______ when added to the user session tells us that the session timed out

  1. SessionTimedoutIndicator

  2. SessionTotalTimeOutIndicator

  3. SessionTotalTimedoutIndicator

  4. SessionTimeoutIndicator


Correct Option: A

Following method(s) cannot be overridden in the JSP page.

  1. jspDestroy()

  2. jspInit()

  3. _jspService()

  4. getParameter()


Correct Option: C

AI Explanation

To answer this question, we need to understand the concept of JSP (JavaServer Pages) and method overriding.

JSP is a technology used to create dynamic web pages. It allows for the separation of HTML code from Java code, making it easier to develop and maintain web applications.

In JSP, we can override certain methods to customize the behavior of the JSP page. However, not all methods can be overridden. Let's go through each option to understand why it is correct or incorrect:

Option A) jspDestroy() - This option is incorrect. The jspDestroy() method is part of the JSP life cycle and can be overridden to perform cleanup tasks when the JSP page is being destroyed.

Option B) jspInit() - This option is incorrect. The jspInit() method is part of the JSP life cycle and can be overridden to perform initialization tasks when the JSP page is being initialized.

Option C) _jspService() - This option is correct. The _jspService() method is automatically generated by the JSP container and cannot be overridden. It is responsible for handling the HTTP requests and generating the dynamic content of the JSP page.

Option D) getParameter() - This option is incorrect. The getParameter() method is not related to method overriding in JSP. It is a method of the HttpServletRequest class, which is used to retrieve the values of request parameters.

The correct answer is C) _jspService(). This option is correct because the _jspService() method cannot be overridden in JSP.

The tag %@include file=”.........” % > helps in including the ______ file in the JSP page

  1. readOnly==

  2. dynamic

  3. static==

  4. None of the above


Correct Option: C

When a JSP page is compiled, what is it turned into?

  1. Applet

  2. Servlet

  3. Application

  4. Midlet


Correct Option: B

Which tag in the jsp is used to define the error page

  1. None of the above

  2. location

  3. exception-type

  4. error-page


Correct Option: D

Which of the tag is used to show the comments in the JSP page


Correct Option: D

Which codeline must be set before any of the lines that use the PrintWriter

  1. setContentWriter()

  2. setWriter()

  3. setPrintType()

  4. setContentType()


Correct Option: D

Implementing the tag < %@ page isThreadSafe="false" % >implements the SingleThreadModel interface making the Jsp

  1. None of the above

  2. content safe

  3. synchornised

  4. thread safe


Correct Option: D

The error message displayed when the page is not found at the correct location

  1. 550

  2. 440

  3. 505

  4. 404


Correct Option: D

The jsp:plugin tag is used to insert the browser-specific OBJECTS and EMBED elements

  1. True

  2. False


Correct Option: A

Which of the following statement is true for the include directive Can be used to incorporate contents from static documents

  1. It offers option of sharing local variables and better run time efficiency

  2. Provides benefit of automatic recompilation

  3. It is processed during translation and compilation and does not impose any restrictions on output buffering

  4. none of the above


Correct Option: A

Which of the following statement is true for the tag

  1. It offers option of sharing local variables and better run time efficiency

  2. Can be used to incorporate contents from static documents

  3. Provides benefit of automatic recompilation

  4. Can include dynamically generated output


Correct Option: B,C

State true or false :- URL instance represents the location of a resource

  1. True

  2. False


Correct Option: A
- Hide questions