Samual Sam has Published 2492 Articles

Please explain lifecycle of a JSP

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

163 Views

A JSP life cycle is defined as the process from its creation till the destruction. This is similar to a servlet life cycle with an additional step which is required to compile a JSP into servlet.Paths Followed By JSPThe following are the paths followed by a JSP −CompilationInitializationExecutionCleanupThe four major ... Read More

What is the use of tag in JSP?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

344 Views

The tag formats a URL into a string and stores it into a variable. This tag automatically performs URL rewriting when necessary. The var attribute specifies the variable that will contain the formatted URL.The JSTL url tag is just an alternative method of writing the call to the response.encodeURL() ... Read More

LocalDate withMonth() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

112 Views

An immutable copy of a LocalDate with the month altered as required is done using the method withMonth() in the LocalDate class in Java. This method requires a single parameter i.e. the month that is to be set in the LocalDate and it returns the LocalDate with the month altered ... Read More

Java Program to output fixed number of array elements in a line

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

148 Views

To output fixed number of array elements in a line, we should check for a condition and if that is true, we should place System.out.println(); properly to get a line and the process goes on.Here, we will display 5 elements in a line. At first, create a new integer array ... Read More

Does Ternary operation exist in MySQL just like C or C++?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

49 Views

Yes, let us first see the working of ternary operator in C or C++ language.X=(X > 10 && ( X-Y) < 0) ?: X:(X-Y);Here is the demo code in C language. After that we will check in MySQL. The C code is as follows −#include int main() {   ... Read More

How to format number in JSP?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

2K+ Views

The tag is used to format numbers, percentages, and currencies.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueNumeric value to displayYesNonetypeNUMBER, CURRENCY, or PERCENTNoNumberpatternSpecify a custom formatting pattern for the output.NoNonecurrencyCodeCurrency code (for type = "currency")NoFrom the default localecurrencySymbolCurrency symbol (for type = "currency")NoFrom the default localegroupingUsedWhether to group numbers ... Read More

LocalDate withDayOfYear() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

43 Views

An immutable copy of a LocalDate with the day of year altered as required is done using the method withDayOfYear() in the LocalDate class in Java. This method requires a single parameter i.e. the day of year that is to be set in the LocalDate and it returns the LocalDate ... Read More

Java Program to calculate the time of sorting an array

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

559 Views

To calculate the time of sorting an array, let us first create an array and add elements to it −int[] arr = new int[1000]; for (int i = 0; i < arr.length; i++) {    arr[i] = (int)(i + 20); }Now, set tow Date variables i.e. for past and future ... Read More

Create a column on my table that allows null but is set by default to empty (not null)?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

547 Views

You need to use default keyword for this. The syntax is as follows −alter table yourTableName add yourColumnName yourDataType NULL Default '';To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table AllowNullDefaulNotNullDemo    -> (    -> Id ... Read More

C++ Program to Find Size of the Largest Independent Set(LIS) in a Given a Binary Tree

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

133 Views

This is a C++ Program to Find Size of the Largest Independent Set (LIS) in a Given a Binary Tree.AlgorithmBegin.    Create a structure n to declare data d, a left child pointer l and a right child pointer r.    Call a function max() to return maximum between two ... Read More

Advertisements