Samual Sam has Published 2310 Articles

How to convert Wrapper value array list into primitive array in Java?

Samual Sam

Samual Sam

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

695 Views

Here, to convert Wrapper value array list into primitive array, we are considering Integer as Wrapper, whereas double as primitive.At first, declare an Integer array list and add elements to it −ArrayList < Integer > arrList = new ArrayList < Integer > (); arrList.add(5); arrList.add(10); arrList.add(15); arrList.add(20); arrList.add(25); arrList.add(30); arrList.add(45); ... Read More

Search a value in JavaTuples Quartet class

Samual Sam

Samual Sam

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

115 Views

To search a value in JavaTuples Quartet class, you need to use the contains() method.Let us first see what we need to work with JavaTuples. To work with Quartet class in JavaTuples, you need to import the following package −import org.javatuples.Quartet;Note − Steps to download and run JavaTuples program. If ... Read More

Please explain lifecycle of a JSP

Samual Sam

Samual Sam

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

380 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

490 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

152 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

197 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

113 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

3K+ 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

66 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

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

667 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

Advertisements