Samual Sam has Published 2310 Articles

How to parse percentages in JSP?

Samual Sam

Samual Sam

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

413 Views

The tag is used to parse numbers, percentages, and currencies.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueNumeric value to read (parse)NoBodytypeNUMBER, CURRENCY, or PERCENTNonumberparseLocaleLocale to use when parsing the numberNoDefault localeintegerOnlyWhether to parse to an integer (true) or floating-point number (false)NofalsepatternCustom parsing patternNoNonetimeZoneTime zone of the displayed dateNoDefault time ... Read More

LocalTime minusNanos() method in Java

Samual Sam

Samual Sam

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

120 Views

An immutable copy of a LocalTime object where some nanoseconds are subtracted from it can be obtained using the minusNanos() method in the LocalTime class in Java. This method requires a single parameter i.e. the number of nanoseconds to be subtracted and it returns the LocalTime object with the subtracted ... Read More

Create Quintet Tuple in Java using with() method

Samual Sam

Samual Sam

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

123 Views

The with() method is used in Java to create Quintet Tuple.Let us first see what we need to work with JavaTuples. To work with Quintet class in JavaTuples, you need to import the following package −import org.javatuples.Quintet;Note − Steps to download and run JavaTuples program. If you are using Eclipse ... Read More

How to randomize and shuffle array of numbers in Java?

Samual Sam

Samual Sam

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

735 Views

At first, create an integer array −int[] arr = { 20, 40, 60, 80, 100, 120, 140, 160, 180, 200};Now, create a Random class object −Random rand = new Random();Loop until the length of the array and shuffle the elements −for (int i = 0; i < arr.length; ++i) { ... Read More

LocalTime minusHours() method in Java

Samual Sam

Samual Sam

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

143 Views

An immutable copy of a LocalTime object where some hours are subtracted from it can be obtained using the minusHours() method in the LocalTime class in Java. This method requires a single parameter i.e. the number of hours to be subtracted and it returns the LocalTime object with the subtracted ... Read More

How to write a comment in a JSP page?

Samual Sam

Samual Sam

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

14K+ Views

JSP comment marks to text or statements that the JSP container should ignore. A JSP comment is useful when you want to hide or "comment out", a part of your JSP page.Following is the syntax of the JSP comments −Following example shows the JSP Comments − ... Read More

Read Data from a Text File using C++

Samual Sam

Samual Sam

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

12K+ Views

This is a C++ program to read data from a text file.Inputtpoint.txt is having initial content as “Tutorials point.”OutputTutorials point.AlgorithmBegin    Create an object newfile against the class fstream.    Call open() method to open a file “tpoint.txt” to perform write operation using object newfile.    If file is open ... Read More

How to format date in JSP?

Samual Sam

Samual Sam

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

5K+ Views

The tag is used to format dates in a variety of ways.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueDate value to displayYesNonetypeDATE, TIME, or BOTHNodatedateStyleFULL, LONG, MEDIUM, SHORT, or DEFAULTNodefaulttimeStyleFULL, LONG, MEDIUM, SHORT, or DEFAULTNodefaultpatternCustom formatting patternNoNonetimeZoneTime zone of the displayed dateNoDefault time zonevarName of the variable to store ... Read More

LocalDate getEra() method in Java

Samual Sam

Samual Sam

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

87 Views

The era for a particular LocalDate can be obtained using the getEra() method in the LocalDate class in Java. This method requires no parameters and it returns the era applicable for the LocalDate.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Main { ... Read More

Java Program to shift array elements to the right

Samual Sam

Samual Sam

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

470 Views

Let us first create an int array −int[] arr = { 10, 20, 30, 40, 50, 60, 70, 80, 90 };Now, shift array elements to the right with arraycopy() and placing the elements correctly so that it gets shifted to the right −System.arraycopy(arr, 0, arr, 1, arr.length - 1);Example Live Demoimport ... Read More

Advertisements