Karthikeya Boyini has Published 2383 Articles

Get a value from Triplet class in JavaTuples

karthikeya Boyini

karthikeya Boyini

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

193 Views

The getValueX() method is used to get a value from the Triplet Tuple class in Java at a particular index. For example, getValue0().Let us first see what we need to work with JavaTuples. To work with Triplet class in JavaTuples, you need to import the following package −import org.javatuples.Triplet;Note − ... Read More

LocalDate lengthOfMonth() method in Java

karthikeya Boyini

karthikeya Boyini

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

81 Views

The length of the month in a particular LocalDate is obtained using the method lengthOfMonth() in the LocalDate class in Java. This method requires no parameters and it returns the length of the month in a particular LocalDate i.e. 28, 29, 30 or 31.A program that demonstrates this is given ... Read More

How to shuffle an array in Java?

karthikeya Boyini

karthikeya Boyini

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

2K+ Views

Declare a string array and add elements in the form of letters −String[] letters = { "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };Convert the above array to list −Listlist = Arrays.asList(letters);Now, create a shuffled array using the Random class object and generate the random letters ... Read More

What are JSP comments?

karthikeya Boyini

karthikeya Boyini

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

6K+ Views

JSP comment marks 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

How to parse date in JSP?

karthikeya Boyini

karthikeya Boyini

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

721 Views

The tag is used to parse dates.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueDate value to read (parse)NoBodytypeDATE, TIME, or BOTHNodatedateStyleFULL, LONG, MEDIUM, SHORT, or DEFAULTNoDefaulttimeStyleFULL, LONG, MEDIUM, SHORT, or DEFAULTNoDefaultparseLocaleLocale to use when parsing the dateNoDefault localepatternCustom parsing patternNoNonetimeZoneTime zone of the parsed dateNoDefault time zonevarName of the ... Read More

LocalDate getMonthValue() method in Java

karthikeya Boyini

karthikeya Boyini

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

90 Views

The month of the year is obtained using getMonthValue() method in the LocalDate class in Java. This method requires no parameter and it returns the month of the year which may be in the range of 1 to 12.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; ... Read More

Java Program to generate random number array within a range and get min and max value

karthikeya Boyini

karthikeya Boyini

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

1K+ Views

At first, create a double array −double[] val = new double[10];Now, generate and display random numbers in a loop that loops until the length of the above array. We have used nextInt here for random numbers −for (int i = 0; i < val.length; i++) {    val[i] = new ... Read More

Create Quintet Tuple from List in Java

karthikeya Boyini

karthikeya Boyini

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

63 Views

To create a tuple from List, you need to use fromCollection() method.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 ... Read More

I want to use %> literal in JSP page. But it is throwing error. How to escape this syntax in JSP?

karthikeya Boyini

karthikeya Boyini

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

117 Views

You can escape it using backslash character. Replace %> with %/>. Following example showcases the same. A Comment Test Syntax: Today's date:

tmpfile() function in C

karthikeya Boyini

karthikeya Boyini

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

1K+ Views

The function tmpfile() creates a temporary file in binary update mode in C. It initializes in header file of a C program. It always returns a null pointer if the temporary file cannot be created. The temporary file deleted automatically just after the termination of program.SyntaxFILE *tmpfile(void)Return valueIf file creation ... Read More

Advertisements