Anvi Jain has Published 419 Articles

How to get current thread id in android?

Anvi Jain

Anvi Jain

Updated on 29-Jun-2020 13:39:32

2K+ Views

Before getting into example, we should know what thread is. A thread is a lightweight sub-process, it going to do back ground operations without interrupt to ui. This example demonstrate about How to get current thread id in android.Step 1 − Create a new project in Android Studio, go to ... Read More

How to get year in android using year API class?

Anvi Jain

Anvi Jain

Updated on 29-Jun-2020 13:38:12

589 Views

This example demonstrate about How to get year in android using year API class.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

How to get month information in android using yearmonth API class?

Anvi Jain

Anvi Jain

Updated on 29-Jun-2020 13:36:51

227 Views

This example demonstrate about How to get month information in android using yearmonth API class.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

How to get local time and date in android using LocalDateTime API class?

Anvi Jain

Anvi Jain

Updated on 29-Jun-2020 13:35:36

807 Views

This example demonstrate about How to get local time and date in android using LocalDateTime API class.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

How to create a table with auto-increment column in MySQL using JDBC?

Anvi Jain

Anvi Jain

Updated on 29-Jun-2020 13:12:06

2K+ Views

While creating a table, in certain scenarios, we need values to column such as ID, to be generated/incremented automatically. Various databases support this feature in different ways.In MySQL database you can declare a column auto increment using the following syntax.CREATE TABLE table_name(    ID INT PRIMARY KEY AUTO_INCREMENT,    column_name1 ... Read More

Avoid placing password on command line with MySQL Utilities?

Anvi Jain

Anvi Jain

Updated on 29-Jun-2020 08:04:20

257 Views

First you need to reach the location of “my.cnf” with the help of below query for MySQL Utilities. The query is as follows −mysql> select @@datadir;The following is the output that display where “my.conf” is −+---------------------------------------------+ | @@datadir                         ... Read More

Tada Animation Effect with CSS

Anvi Jain

Anvi Jain

Updated on 29-Jun-2020 08:01:06

490 Views

To create Tada animation effect with CSS, you can try to run the following code:ExampleLive Demo                    .animated {             background-image: url(/css/images/logo.png);             background-repeat: no-repeat;             ... Read More

Simple way to toggle a value of an int field in MySQL

Anvi Jain

Anvi Jain

Updated on 29-Jun-2020 07:52:06

485 Views

To toggle a value of an int field, you can use update command with if(). The syntax is as follows −update yourTableName set yourColumnName = IF(yourColumnName = 0, 1, 0);To understand the above toggle syntax, create a table with some int value. The query to create a table is as ... Read More

Create and demonstrate an immutable collection in Java

Anvi Jain

Anvi Jain

Updated on 29-Jun-2020 06:41:47

240 Views

In order to create and demonstrate an immutable collection in Java, we use the unmodifiableCollection() method. This method returns an unmodifiable and immutable view of the collection.Declaration − The java.util.Collections.unmodifiableCollection() method is declared as follows -public static Collection unmodifiableCollection(Collection

Determining If an Object Is an Array in Java

Anvi Jain

Anvi Jain

Updated on 29-Jun-2020 06:38:56

6K+ Views

In order to determine if an object is an Object is an array in Java, we use the isArray() and getClass() methods.The isArray() method checks whether the passed argument is an array. It returns a boolean value, either true or falseSyntax - The isArray() method has the following syntax -Array.isArray(obj)The getClass() ... Read More

Advertisements