Samual Sam has Published 2310 Articles

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

176 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

Iterate through Quartet class in JavaTuples

Samual Sam

Samual Sam

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

149 Views

You can also iterate through Quartet class like Arrays using a loop.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 you are using ... Read More

LocalDate lengthOfYear() method in Java

Samual Sam

Samual Sam

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

54 Views

The length of the year in a particular LocalDate is obtained using the method lengthOfYear() in the LocalDate class in Java. This method requires no parameters and it returns the length of the year in a particular LocalDate i.e. 365 or 366 for a leap year.A program that demonstrates this ... Read More

LocalDateTime getDayOfMonth() method in Java

Samual Sam

Samual Sam

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

359 Views

The day of the month for a particular LocalDateTime can be obtained using the getDayOfMonth() method in the LocalDateTime class in Java. This method requires no parameters and it returns the day of the month which can be in the range of 1 to 31.A program that demonstrates this is ... Read More

How can we copy one array from another in Java

Samual Sam

Samual Sam

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

389 Views

Let us first create a string array −String[] arr = new String[] { "P", "Q", "R", "S", "T"};Now, calculate the length of the above array and create a new array with the same length −int len = arr.length; String[] arr2 = new String[len];Let us copy one array from another −System.arraycopy(arr, ... Read More

What is a Quintet class in Java Tuples?

Samual Sam

Samual Sam

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

137 Views

A Quintet class is a Tuple of five elements. It is part of the JavaTuples library.The following is the declaration −public final class Quintet extends Tuple implements IValue0, IValue0, IValue0, IValue0, IValue0Let us first see what we need to work with JavaTuples. To work with Quintet class in JavaTuples, you ... Read More

What are JSP declarations? In how many ways we can write JSP declarations?

Samual Sam

Samual Sam

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

294 Views

A declaration declares one or more variables or methods that you can use in Java code later in the JSP file. You must declare the variable or method before you use it in the JSP file.Following is the syntax for JSP Declarations −You can write the XML equivalent of the ... Read More

How to format currencies 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

LocalDateTime withYear() method in Java

Samual Sam

Samual Sam

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

125 Views

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

How to write a JSP Expression?

Samual Sam

Samual Sam

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

477 Views

A JSP expression element contains a scripting language expression that is evaluated, converted to a String, and inserted where the expression appears in the JSP file.Because the value of an expression is converted to a String, you can use an expression within a line of text, whether or not it ... Read More

Advertisements