Chandu yadav has Published 1163 Articles

DoubleStream distinct() method in Java

Chandu yadav

Chandu yadav

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

79 Views

The distinct() method of the DoubleStream class returns a stream consisting of the distinct elements of this stream.The syntax is as followsDoubleStream distinct()To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;Create DoubleStream and add some elements to the streamDoubleStream doubleStream = DoubleStream.of(39.8, 78.7, 64.7, 78.7, 47.8, 89.7, ... Read More

Program execution transfer instructions in 8086 microprocessor

Chandu yadav

Chandu yadav

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

9K+ Views

These instructions are used to transfer/branch the instructions during an execution. There are two types of branching instructions. The unconditional branch and conditional branch.The Unconditional Program execution transfer instructions are as follows.OpcodeOperandDescriptionCALLaddressUsed to call a procedure and save their return address to the stack.RET----Used to return from the procedure to ... Read More

C++ Program to Find Maximum Element in an Array using Binary Search

Chandu yadav

Chandu yadav

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

381 Views

This is a C++ Program to find the maximum element of an array using Binary Search Tree. The time complexity of this program is O(log(n)).AlgorithmBegin Construct the Binary Search Tree using the given data elements. Next traverse the root pointer to the rightmost child ... Read More

IntStream peek() method in Java

Chandu yadav

Chandu yadav

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

566 Views

The peek() method in the IntStream class in Java returns a stream consisting of the elements of this stream. It additionally performs the provided action on each element as elements are consumed from the resulting stream.The syntax is as followsIntStream peek(IntConsumer action)Here, the parameter action is a non-interfering action to ... Read More

How to use the apply() in Android Shared preferences with example?

Chandu yadav

Chandu yadav

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

385 Views

Before getting into shared preference apply(), we should know what is shared preferences in android. Using share preference, we can store or retrieve values as key and value pair. There are five different methods are available in share preference as shown below -Edit()- It going to edit shared preference valuescommit()- ... Read More

8085 Program to do an operation on two numbers based on the contents of X

Chandu yadav

Chandu yadav

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

218 Views

Now let us see a program of Intel 8085 Microprocessor. In this program we will see how to do different operations based on choice.Problem Statement:Write 8085 Assembly language program to perform some operations on two 8-bit binary numbers base on choice.Discussion:In this program we are taking a choice. The choice ... Read More

How to find edit text values start from consonant or not?

Chandu yadav

Chandu yadav

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

61 Views

This example demonstrate about How to find edit text values start from consonant or not.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.   ... Read More

LongStream distinct() method in Java

Chandu yadav

Chandu yadav

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

22 Views

The distinct() method in the LongStream class returns a stream consisting of the distinct elements of this stream.The syntax is as follows.LongStream distinct()To use the LongStream class in Java, import the following package.import java.util.stream.LongStream;Create a LongStream and add elements.LongStream longStream = LongStream.of(100L, 150L, 100L, 300L, 150L, 500L);Now, get the distinct ... Read More

MongoDB query which represents not equal to null or empty?

Chandu yadav

Chandu yadav

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

7K+ Views

To set a query for not equal to null or empty, use the $nin operator. The syntax is as followsdb.yourCollectionName.find({yourFieldName:{$nin:[null, ""]}});Let us create a collection with documents> db.notEqualToNullOrEmptyDemo.insertOne({"UserName":"Larry", "UserAge":24}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9d20b6a629b87623db1b26") } > db.notEqualToNullOrEmptyDemo.insertOne({"UserName":"", "UserAge":29}); {    "acknowledged" : true,    "insertedId" : ... Read More

IntStream forEachOrdered() method in Java

Chandu yadav

Chandu yadav

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

317 Views

The forEachOrdered() method in Java assures that each element is processed in order for streams that have a defined encounter order.The syntax is as followsvoid forEachOrdered(IntConsumer action)Here, the action parameter is a non-interfering action to be performed on the elements.Create an IntStream and add elements to the streamIntStream intStream = ... Read More

Advertisements