Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint
Cover Image
Cover Image
Drag to reposition
Contributed Answers

Factory method to create Immutable List in android?

Answered on 21st Mar, 2019, 0 Views

This example demonstrate about Factory method to create Immutable List 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 code, we have taken listview to add immutable list. Step 3 − Add the following.....

How to check edit text values are Anagram or Not in android?

Answered on 21st Mar, 2019, 0 Views

This example demonstrate about How to check edit text values are Anagram or Not 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 code, we have taken two edit texts to take the data from the user and when .....

How to print current activity name in android?

Answered on 21st Mar, 2019, 0 Views

This example demonstrate about How to print current activity name 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 code, we have taken text view to show current activity name. Step 3 − Add the follo.....

How to get locale information from Network provider in android?

Answered on 20th Mar, 2019, 0 Views

This example demonstrate about How to get locale information from Network provider 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 code, we have taken text view to show locale infomation. Step 3 − .....

Split a string around a particular match in Java

Answered on 19th Feb, 2019, 0 Views

The specified string can be split around a particular match for a regex using the String.split() method. This method has a single parameter i.e. regex and it returns the string array obtained by splitting the input string around a particular match for the regex. A program that demonstrates splitting a string is given as follows:  Live Demo , , Now let us understand the above program. T.....

Validate Email address in Java

Answered on 19th Feb, 2019, 0 Views

The Email address can be validated using the java.util.regex.Pattern.matches() method. This method matches the regular expression for the E-mail and the given input Email and returns true if they match and false otherwise. A program that demonstrates this is given as follows:  Live Demo , , Now let us understand the above program. In the main() method, The Email ID is printed. Then the.....

Use the ? quantifier in Java Regular Expressions

Answered on 19th Feb, 2019, 0 Views

In general, the ? quantifier represents 0 or 1 occurrences of the specified pattern. For example - X? means 0 or 1 occurrences of X. The regex "t.+?m" is used to find the match in the string "tom and tim are best friends" using the ? quantifier. A program that demonstrates this is given as follows:  Live Demo , , Now let us understand the above program. The subsequence “t.+?m&rdq.....

Is null a literal in Java?

Answered on 19th Feb, 2019, 0 Views

The null in Java is a literal of the null type. It cannot be cast to a primitive type such as int. float etc. but can be cast to a reference type. Also, null does not have the value 0 necessarily. A program that demonstrates null in Java is given as follows:  Live Demo , , Now let us understand the above program. In the main() method, the String str is initialized as null. Then the val.....

Minimum and Maximum Priority Threads in Java

Answered on 19th Feb, 2019, 0 Views

The thread priority determines when the processor is provided to the thread as well as other resources. It can be changed using the method setPriority() of class Thread. There are three static variables for thread priority in Java i.e. MIN_PRIORITY, MAX_PRIORITY and NORM_PRIORITY. The values of these variables are 1, 10 and 5 respectively. A program that demonstrates this is given as follow.....

Controlling the main thread in Java

Answered on 19th Feb, 2019, 0 Views

A thread can be created by implementing the Runnable interface and overriding the run() method. The Main thread in Java is the one that begins executing when the program starts. All the child threads are spawned from the Main thread. Also, it is the last thread to finish execution as various shut-down actions are performed by it. A program that demonstrates this is given as follows:  L.....

loader
Advertisements
Contribution

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.