Tag: programming languages

Questions Related to programming languages

Which of the following is the correct syntax for suggesting that the JVM performs garbage collection?

  1. System.free()

  2. System.setGarbageCollection()

  3. System.setGarbage()

  4. System.gc()


Correct Option: D
  1. AirthmaticFormat

  2. CurrencyFormat

  3. NumberFormat ==

  4. StringBuffer


Correct Option: C
  1. The Local Systems IP Address

  2. Local Systems Port Number

  3. Remote System’s IPAddress

  4. All of the above


Correct Option: D
  1. jspDestroy()

  2. jspInit()==

  3. _jspService()

  4. getParameter()


Correct Option: A
  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
  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
  1. Script language declarations, scriplets and expressions.

  2. JSP standard actions

  3. JSP standard directives

  4. All the Above


Correct Option: D
  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.