George John has Published 1081 Articles

How to add line break for UILabel in iOS/iPhone?

George John

George John

Updated on 29-Jun-2020 13:52:56

3K+ Views

Line break in a UILabel is used to change how the text appears on a label. Suppose a label has text more than two lines but by default the Line break in a UILabel is used to change how the text appears on a label. Suppose a label has text ... Read More

Replace an element in an ArrayList using the ListIterator in Java

George John

George John

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

1K+ Views

An element in ArrayList can be replaced using the ListIterator method set(). This method has a single parameter i.e. the element that is to be replaced and the set() method replaces it with the last element returned by the next() or previous() methods.A program that demonstrates this is given as ... Read More

Traverse TreeSet elements in descending order in java

George John

George John

Updated on 29-Jun-2020 13:26:15

411 Views

Create TreeSet and add elements to itTreeSet tSet = new TreeSet(); tSet.add("P"); tSet.add("Q"); tSet.add("R"); tSet.add("S");Now, let us traverse elements in descending orderIterator j = tSet.descendingIterator(); while(j.hasNext()) {    System.out.println(j.next()); }The following is an example to traverse TreeSet elements in descending orderExample Live Demoimport java.util.*; public class Demo {    public static ... Read More

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

134 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

176 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

What is the MySQL user creation script?

George John

George John

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

1K+ 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

174 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

152 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

718 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

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