Karthikeya Boyini has Published 2193 Articles

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

93 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

159 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

Java Program to get minimum value with Comparator

karthikeya Boyini

karthikeya Boyini

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

376 Views

First, declare an integer array and add some elements −Integer arr[] = { 40, 20, 30, 10, 90, 60, 700 };Now, convert the above array to List −List list = Arrays.asList(arr);Now, use Comparator and the reverseOrder() method. Using max() will eventually give you the maximum value, but with reverseOrder() it ... Read More

Java Tuple setAt0() method for Pair class

karthikeya Boyini

karthikeya Boyini

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

278 Views

The setAt0() method is used to set the Pair value in JavaTuples and a copy with a new value at the specified index i.e. index 0 here.Let us first see what we need to work with JavaTuples. To work with Pair class in JavaTuples, you need to import the following ... Read More

How many types of directive tags JSP supports?

karthikeya Boyini

karthikeya Boyini

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

221 Views

A JSP directive affects the overall structure of the servlet class. It usually has the following form −Directives can have a number of attributes which you can list down as key-value pairs and separated by commas.The blanks between the @ symbol and the directive name, and between the last attribute ... Read More

How to set locate to identify required resource bundle in JSP?

karthikeya Boyini

karthikeya Boyini

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

214 Views

The tag is used to store the given locale in the locale configuration variable.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueSpecifies a two-part code that represents the ISO-639 language code and an ISO-3166 country code.Yesen_USvariantBrowser-specific variantNoNonescopeScope of the locale configuration variableNoPageExampleResource bundles contain locale-specific objects. Resource bundles contain key/value ... Read More

How to restrict UITextField to take only numbers in Swift?

karthikeya Boyini

karthikeya Boyini

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

6K+ Views

In iOS apps sometimes we need to restrict our text field to take only numbers as an input, this can be done in several ways, let’s see some of them.Method 1: Changing the Text Field Type from storyboard.Select the text field that you want to restrict to numeric input.Go to ... Read More

The contains() method of Quintet class in JavaTuples

karthikeya Boyini

karthikeya Boyini

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

78 Views

Use the contains() method to search a value in the Quintet class in JavaTuples.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 ... Read More

Advertisements