George John has Published 1081 Articles

How to check android mobile supports HUMIDITY sensor?

George John

George John

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

242 Views

This example demonstrate about How to check android mobile supports HUMIDITY sensorStep 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.     In the ... Read More

How to Go back to previous activity in android

George John

George John

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

5K+ Views

If you wants to go back from one activity to another activity, This example demonstrate about how to go back to previous activity in android.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 ... Read More

Program for simulation of throwing a die in 8085 Microprocessor

George John

George John

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

564 Views

Write an 8085 assembly language program to simulate the throw of a die using an interrupt.We have a counter for this program, which counts the ranges from 1 to 6, and again repeats the sequence of count in a matter which is endless in an infinite loop. The die throwing ... Read More

How to check android mobile supports LIGHT sensor?

George John

George John

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

363 Views

This example demonstrate about How to check android mobile supports LIGHT sensorStep 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.     In the ... Read More

The lastIndexOf() method of CopyOnWriteArrayList in Java

George John

George John

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

114 Views

The lastIndexOf() method returns the index of the last occurrence of the specified element in this list. It returns -1 if this list does not contain the element.The syntax is as followspublic int lastIndexOf(Object ob)Here, ob is the element. The return value would be the last index of this element.To ... Read More

Convert MySQL null to 0?

George John

George John

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

19K+ Views

Use IFNULL or COALESCE() function in order to convert MySQL NULL to 0.The syntax is as followsSELECT IFNULL(yourColumnName, 0) AS anyAliasName FROM yourTableName; The second syntax is as follows: SELECT COALESCE(yourColumnName, 0) AS anyAliasName FROM yourTableName;Let us first create a table. The query to create a table is as followsmysql> ... Read More

DoubleStream peek() method in Java

George John

George John

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

207 Views

The syntax is as followsDoubleStream peek(DoubleConsumer action)Here, DoubleConsumer is an operation that accepts a single double-valued argument and returns no result.To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;The following is an example to implement DoubleStream peek() method in JavaExample Live Demoimport java.util.*; import java.util.stream.DoubleStream; public class Demo ... Read More

How to add elements to AbstractSequentialList class at a specific position in Java?

George John

George John

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

109 Views

The AbstractSequentialList class has the add() method to add an element to the specific position.The syntax is as followsadd(int index, E ele)Here, index is where the element is to be inserted. The ele is the element to be inserted.To work with the AbstractSequentialList class in Java, you need to import ... Read More

How to use action down event in android?

George John

George John

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

366 Views

 This example demonstrate about How use action down event in android.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.     In the above ... Read More

DoubleStream sequential() method in Java

George John

George John

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

97 Views

The sequential() method of the DoubleStream class returns an equivalent stream that is sequential.The syntax is as followsDoubleStream sequential()To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;Create a DoubleStream and add some elementsDoubleStream doubleStream1 = DoubleStream.of(45.8, 67.9, 78.5, 90.6, 97.4);Now create an equivalent stream that is sequentialDoubleStream ... Read More

Advertisements