George John has Published 1234 Articles

Get first value in Java TreeSet

George John

George John

Updated on 29-Jun-2020 13:23:53

1K+ Views

To get the first value in TreeSet, use the first() method.First, get the TreeSet and add elements to itTreeSet tSet = new TreeSet(); tSet.add("10"); tSet.add("20"); tSet.add("30"); tSet.add("40"); tSet.add("50"); tSet.add("60");Now, get the first valuetSet.first()The following is an example to get the first value in TreeSetExample Live Demoimport java.util.*; public class Demo { ... Read More

NavigableMap higherEntry() method in Java

George John

George John

Updated on 29-Jun-2020 13:13:04

69 Views

The higherEntry() method in NavigableMap returns a key-value mapping associated with the least key strictly greater than the given key.The following is an example to implement higherEntry() method −Example Live Demoimport java.util.*; public class Demo {    public static void main(String[] args) {       NavigableMap n = new TreeMap(); ... Read More

Check whether IdentityHashMap empty or not in Java?

George John

George John

Updated on 29-Jun-2020 13:10:42

104 Views

Check whether a Map is empty or not using the isEmpty() method.Let us first create a IdentityHashMap and add some elements to itMap m= new IdentityHashMap(); m.put("1", 100); m.put("2", 200); m.put("3", 300); m.put("4", 150); m.put("5", 110); m.put("6", 50); m.put("7", 90); m.put("8", 250); m.put("9", 350); m.put("10", 450);Now, use the following method ... Read More

SMTP protocol client in Python (smtplib)

George John

George John

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

990 Views

Python's standard library has 'smtplib' module which defines an SMTP client session object that can be used to send mail via Python program.A mail server is an application that handles and delivers e-mail over the internet. Outgoing mail servers implement SMTP, or Simple MailTransfer Protocol, servers which are an Internet ... Read More

What is the MySQL user creation script?

George John

George John

Updated on 29-Jun-2020 12:19:59

785 Views

First, create a user and password using CREATE command. The syntax is as follows.CREATE USER 'yourUserName'@'localhost' IDENTIFIED BY 'yourPassword';The syntax to give all privileges of the specific database to the user is as follows.GRANT ALL PRIVILEGES ON yourDatabaseName . * TO 'yourUserName'@'localhost';Now you can implement the above syntaxes to create ... Read More

How to find Wi-Fi maximum speed supports in android?

George John

George John

Updated on 29-Jun-2020 12:04:04

95 Views

This example demonstrate about How to find Wi-Fi maximum speed supports 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 ... Read More

How to do reverse sort volley elements in android?

George John

George John

Updated on 29-Jun-2020 11:57:21

65 Views

This example demonstrate about How to sort volley elements 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

How to read volley json array object elements in android?

George John

George John

Updated on 29-Jun-2020 11:56:42

587 Views

This example demonstrate about How to read volley json array object elements 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 ... Read More

HTML Tag

George John

George John

Updated on 29-Jun-2020 09:35:28

121 Views

The tag in HTML is used to set font color, font family and font size. Following is the attributes −color: Set the color of the font.face: Set the font face i.e. family.size: Set the font sizeNote − The tag isn’t supported in HTML5.Let us now see an example ... Read More

How to check android mobile supports GRAVITY sensor?

George John

George John

Updated on 29-Jun-2020 09:35:03

358 Views

This example demonstrate about How to check android mobile supports GRAVITY 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 above ... Read More

Previous 1 ... 6 7 8 9 10 ... 124 Next
Advertisements