Chandu yadav

Chandu yadav

810 Articles Published

Articles by Chandu yadav

Page 3 of 81

DoubleStream mapToInt() method in Java

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 184 Views

The mapToInt() function of the DoubleStream class returns an IntStream consisting of the results of applying the given function to the elements of this stream.The syntax is as followsIntStream mapToInt(DoubleToIntFunction mapper)Here, mapper is a stateless function to apply to each element. The DoubleToIntFunction is a function that accepts a double-valued argument and produces an int-valued result.To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;The following is an example to implement DoubleStream mapToInt() method in JavaExampleimport java.util.stream.IntStream; import java.util.stream.DoubleStream; public class Demo {    public static void main(String[] args) {       DoubleStream doubleStream = DoubleStream.of(45.8, 78.9, ...

Read More

DoubleStream sorted() method in Java

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 137 Views

The sorted() method of the DoubleStream class returns a stream consisting of the elements of this stream in sorted order.The syntax is as followsDoubleStream sorted()To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;Create a DoubleStream and add some elements to the streamDoubleStream doubleStream = DoubleStream.of(78.9, 90.4, 27.9, 20.6, 45.3, 18.5);Now, sort the elements of the streamdoubleStream.sorted().The following is an example to implement DoubleStream sorted() method in JavaExampleimport java.util.*; import java.util.stream.DoubleStream; public class Demo {    public static void main(String[] args) {       DoubleStream doubleStream = DoubleStream.of(78.9, 90.4, 27.9, 20.6, 45.3, 18.5);       System.out.println("Sorted ...

Read More

HTML <form> target Attribute

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 413 Views

The target attribute of the element allows you to display the response generated after submitting the form.Following is the syntax −Here, _blank is used to display the response in new window or tab, _self display the response in the same frame, _parent displays the response in the parent frame, _top displays the response in the entire body of the window, frame displays the response in a named frame.Let us now see an example to implement the target attribute of the element −Example Points    Player:    Rank:    Points:    Submit ...

Read More

DoubleStream.Builder add() method in Java

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 144 Views

The add() method of the DoubleStream.Builder class in Java adds an element to the stream being built. The method returns this builder.The syntax is as followsdefault DoubleStream.Builder add(double ele)Here, ele is the element to be added to this stream.To use the DoubleStream.Builder class in Java, import the following packageimport java.util.stream.DoubleStream; Create DoubleStream.Builder: DoubleStream.Builder builder = DoubleStream.builder(); Now add some elements: builder.add(23.5); builder.add(33.1); builder.add(35.6); builder.add(53.1);The following is an example to implement DoubleStream.Builder add() method in JavaExampleimport java.util.stream.DoubleStream; public class Demo {    public static void main(String[] args) {       DoubleStream.Builder builder = DoubleStream.builder();       builder.add(23.5);     ...

Read More

DoubleStream anyMatch() method in Java

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 142 Views

The anyMatch() method of the DoubleStream class returns whether any elements of this stream match the provided predicate.The syntax is as followsboolean anyMatch(DoublePredicate predicate)Here, the parameter predicate is a stateless predicate to apply to elements of this stream. The DoublePredicate here is a predicate of one double-valued argument.To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;Create a DoubleStream and add some elements to the streamDoubleStream doubleStream = DoubleStream.of(67.9, 89.9, 10.5, 95.8, 49.6);Now, check if any of the elements match the predicateboolean res = doubleStream.anyMatch(a -> a > 50);The following is an example to implement DoubleStream anyMatch() method ...

Read More

imagecolorstotal() function in PHP

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 95 Views

The imagecolorstotal() function gets the count of colors in an image's paletteSyntaximagecolorstotal (img)Parametersimg: Image created with imagecreatetruecolor().ReturnThe imagecolorstotal() function returns the number of colors in an image palette.ExampleThe following is an exampleOutputThe following is the output:Number of Colors = 128

Read More

DoubleStream forEachOrdered() method in Java

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 157 Views

The forEachOrdered() method of the DoubleStream class in Java performs an action for each element of this stream. This assures that each element is processed in encounter order for streams that have a defined encounter order.The syntax is as followsvoid forEachOrdered(DoubleConsumer action)Here, DoubleConsumer represents an operation that accepts a single double-valued argument and returns no result. The parameter action is a non-interfering action to perform on the elements.To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;The following is an example to implement DoubleStream forEachOrdered() method in Java:Exampleimport java.util.stream.DoubleStream; public class Demo {    public static void main(String[] ...

Read More

HTML <area> type Attribute

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 127 Views

The type attribute of the element sets the MIME (Multipurpose Internet Mail Extensions) type of the target url. Following is the syntax −Above, type_of_media is the standard media type of the linked document, for example, image/bmp, image/tiff, image/tff, etc.Let us now see an example to implement the type attribute of the element −Example Learning Learn these technologies with ease....             OutputNow, when you will click on the HTML area, then the following png image would be visible. We have set the media type in that as image/png for the same −

Read More

The toArray() method of Java AbstractCollection class

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 182 Views

The toArray() method of the AbstractCollection class is used to return the elements in this collection. The elements are returned in the form of an array.The syntax is as followspublic Object[] toArray()To work with AbstractCollection class in Java, import the following packageimport java.util.AbstractCollection;At first, declare AbstractCollection and add some elementsAbstractCollection absCollection = new ArrayList(); absCollection.add("Laptop"); absCollection.add("Tablet"); absCollection.add("Mobile"); absCollection.add("E-Book Reader");Now, use the toArray() method to return the elements in the form of an arrayObject[] myArr = absCollection.toArray();The following is an example to implement AbstractCollection toArray() method in JavaExampleimport java.util.ArrayList; import java.util.AbstractCollection; public class Demo {    public static void main(String[] args) ...

Read More

LongStream forEach() method in Java

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 209 Views

The forEach() method of the LongStream class in Java performs an action for each element of this stream.The syntax is as followsvoid forEach(LongConsumer action)Here, the parameter action is a non-interfering action to perform on the elements. LongConsumer represents an operation that accepts a single long-valued argument and returns no result.To use the LongStream class in Java, import the following packageimport java.util.stream.LongStream;The following is an example to implement LongStream forEach() method in JavaExampleimport java.util.*; import java.util.stream.LongStream; public class Demo { public static void main(String[] args) { LongStream longStream = LongStream.of(1000L, 12000L, 30000L); ...

Read More
Showing 21–30 of 810 articles
« Prev 1 2 3 4 5 81 Next »
Advertisements