Samual Sam has Published 2492 Articles

How to delete element from linked list for listview in Android?

Samual Sam

Samual Sam

Updated on 29-Jun-2020 15:52:32

401 Views

This example demonstrate about How to delete element from linked list for listview in AndroidStep 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

How to delete all elements from linked list for listview in Android?

Samual Sam

Samual Sam

Updated on 29-Jun-2020 15:50:38

80 Views

This example demonstrate about How to delete all elements from linked list for listview in AndroidStep 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

Get the intersection of two sets in Java

Samual Sam

Samual Sam

Updated on 29-Jun-2020 08:07:56

13K+ Views

To get the intersection of two sets, use the retainAll() method. Here are out two set −First set −HashSet set1 = new HashSet (); set1.add("Mat"); set1.add("Sat"); set1.add("Cat");Second set −HashSet set2 = new HashSet (); set2.add("Mat"); set2.add("Cat"); set2.add("Fat"); set2.add("Hat");Get the intersection −set1.retainAll(set2);The following is an example to get the ... Read More

Swing Animation Effect with CSS

Samual Sam

Samual Sam

Updated on 29-Jun-2020 08:00:14

723 Views

The swing animation effect move or cause to move back and forth or from side to side while suspended or on an axis to an element.ExampleLive Demo                    .animated {             background-image: url(/css/images/logo.png);       ... Read More

Flatten the color depth with CSS

Samual Sam

Samual Sam

Updated on 29-Jun-2020 07:15:42

195 Views

To flatten the color depth, you need to create an X-Ray.The following parameter is used in this filter −S.NoParameter & Description1XrayGrayscales and flattens the color depth.ExampleYou can try to run the following code to create an X-Ray effect −Live Demo                   CSS Tutorials    

Format Month in MM format in Java

Samual Sam

Samual Sam

Updated on 29-Jun-2020 05:50:56

814 Views

The MM format is for months in two-digits 01, 02, 03, 04, etc. Here, we will use the following.SimpleDateFormat("MM");Let us see an example −// displaying month in MM format SimpleDateFormat simpleformat = new SimpleDateFormat("MM"); String strMonth = simpleformat.format(new Date()); System.out.println("Month in MM format = "+strMonth)Above, we have used the SimpleDateFormat ... Read More

Parse Octal string to create BigInteger in Java

Samual Sam

Samual Sam

Updated on 29-Jun-2020 05:48:05

113 Views

To parse the octal string to create BigInteger, use the following BigInteger constructor and set the radix as 8 for Octal −BigInteger(String val, int radix)This constructor is used to translate the String representation of a BigInteger in the specified radix into a BigInteger.In the below example, we have set the ... Read More

Parse hexadecimal string to create BigInteger in Java

Samual Sam

Samual Sam

Updated on 29-Jun-2020 05:46:43

1K+ Views

To parse the hexadecimal string to create BigInteger, use the following BigInteger constructor and set the radix as 16 for Hexadecimal.BigInteger(String val, int radix)This constructor is used to translate the String representation of a BigInteger in the specified radix into a BigInteger.In the below example, we have set the BigInteger ... Read More

Parsing and Formatting a Big Integer into Binary in Java

Samual Sam

Samual Sam

Updated on 29-Jun-2020 05:45:49

1K+ Views

Firstly, take two BigInteger objects and set values.BigInteger one, two; one = new BigInteger("99"); two = new BigInteger("978");Now, parse BigInteger object “two” into Binary.two = new BigInteger("1111010010", 2); String str = two.toString(2);Above, we have used the following constructor. Here, radix is set as 2 for Binary for both BigInteger constructor ... Read More

Parsing and Formatting a Byte Array into Binary in Java

Samual Sam

Samual Sam

Updated on 29-Jun-2020 05:44:09

3K+ Views

Set a BigInteger object.BigInteger one;Now, create a ByteArray.byte byteArr[] = new byte[] { 0x1, 0x00, 0x00 }; one = new BigInteger(byteArr);For Binary, we have used 2 as the toString() method parameter.String strResult = one.toString(2);The following is an example −Example Live Demoimport java.math.*; public class Demo {    public static void main(String[] ... Read More

Advertisements