Get Size of TreeSet in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

510 Views

To get the size of TreeSet, use the size() method.Create a TreeSet and add elements to it −TreeSet tSet = new TreeSet(); tSet.add("78"); tSet.add("56"); tSet.add("88"); tSet.add("12");Now, get the size of the TreeSet −tSet.size()The following is an example to get the size of TreeSet in Java −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]){ TreeSet tSet = new TreeSet(); tSet.add("78"); tSet.add("56"); tSet.add("88"); tSet.add("12"); ... Read More

Decrease a Row Value by 1 in MySQL

Anvi Jain
Updated on 30-Jul-2019 22:30:24

900 Views

You can increase and decrease row value by 1 in MySQL using UPDATE command. The syntax is as follows −UPDATE yourTableName set yourColumnName = yourColumnName-1 where condition;Let us create a table to decrease row value by 1. The following is the query −mysql> create table IncrementAndDecrementValue    −> (    −> UserId int,    −> UserScores int    −> ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into IncrementAndDecrementValue values(101, 20000); Query OK, 1 row affected (0.13 sec) mysql> insert into IncrementAndDecrementValue values(102, 30000); ... Read More

Set Delay in Android

Ankith Reddy
Updated on 30-Jul-2019 22:30:24

6K+ Views

In some cases, after some time we need to update on UI to solve this problem, In this example demonstrate how to set a delay 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, primary it shows "initial text" after some delay it will update with new text.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.os.Build; import android.os.Bundle; import android.os.Handler; ... Read More

How Search Engines Like Google Work

Jaya P
Updated on 30-Jul-2019 22:30:24

236 Views

Can you imagine your life without Google?? In the present world of digitization, people are completely dependent on search engines for every small information. It is very interesting to know how can Google give so much information on so many websites in a blink of an eye? How does it work?Google has its most powerful tool: its search engine. Google uses a special algorithm to generate search results. It uses automated programs called Spiders or Crawlers. With the help of indexed keywords, and its unique algorithm google displays the search results.Google has the trademarked algorithm called Page Rank, which assigns ... Read More

Special Features of Z-80

Chandu yadav
Updated on 30-Jul-2019 22:30:24

399 Views

In this section we will see some advanced features of Zilog Z-80 Microprocessor. These features are basically compared to the Intel 8085 Microprocessor.The features are listed below −Sr.No.Features & Description1Opcode CountIn this Microprocessor there are 698 Opcodes of different lengths.2Instruction LengthThe instructions can be divided into four categories according to their lengths.There are 202 of 1-byte instructions, 344 of 2-byte instruction74 of 3-byte instruction78 of 4-byte instruction3Opcode LengthThe instructions can also be divided into two parts according to the opcode length. In the instruction set, there are instructions with 1-byte opcode and 2-byte opcode.The number of 1-byte opcode instruction is ... Read More

Increase and Decrease Row Value by 1 in MySQL with Stored Procedure

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:24

672 Views

Let us first create a table to increase and adecrease row value by 1. The following is the query −mysql> create table IncrementAndDecrementValue    −> (    −> UserId int,    −> UserScores int    −> ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into IncrementAndDecrementValue values(101, 20000); Query OK, 1 row affected (0.13 sec) mysql> insert into IncrementAndDecrementValue values(102, 30000); Query OK, 1 row affected (0.20 sec) mysql> insert into IncrementAndDecrementValue values(103, 40000); Query OK, 1 row affected (0.11 sec)Display all records ... Read More

Know When an EditText Loses Focus in Android

Arjun Thakur
Updated on 30-Jul-2019 22:30:24

3K+ Views

This example demonstrates how can I know when an EditText loses focus.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 one edit text and two buttons. remove focus button going to remove the focus of edit text and other button going to gain focus of edit text.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.os.Build; import android.os.Bundle; ... Read More

Sort a List in Reverse Order in Java

Rishi Raj
Updated on 30-Jul-2019 22:30:24

10K+ Views

A list can be sorted in reverse order i.e. descending order using the java.util.Collections.sort() method. This method requires two parameters i.e. the list to be sorted and the Collections.reverseOrder() that reverses the order of an element collection using a Comparator.The ClassCastException is thrown by the Collections.sort() method if there are mutually incomparable elements in the list.A program that demonstrates this is given as follows:Example Live Demoimport java.util.ArrayList; import java.util.Collections; import java.util.List; public class Demo { public static void main(String args[]) { List aList = new ArrayList(); ... Read More

What is Meant by Blue Eyes Technology

Jaya P
Updated on 30-Jul-2019 22:30:24

5K+ Views

The blue eyes technology works on Artificial Intelligence. It aims to give human abilities to a computer. A research team of IBM has come up with this technology to make a computer understand and sense human feelings and behavior.The aim of the blue eyes technology is to give human power or abilities to a computer so that the machine can naturally interact with human beings as humans interact with each other, through speech, facial expressions and touch.All human beings have some perceptual capabilities, the ability to understand each other’s emotional level or feelings from their facial expressions. Blue eyes technology ... Read More

Addressing Modes of Z-80

George John
Updated on 30-Jul-2019 22:30:24

2K+ Views

Here we will see the addressing modes of the Zilog Z-80 Microprocessor. But at first we will discuss about the mnemonics of Z-80.As we know there are many similarities between Intel 8085 and Zilog Z-80, so we can also find the similarity on the instructions. But in Z-80 the Mnemonics are slightly different. The Hex codes are same, but only the mnemonics are different. So, if we want to execute a program, which was written in the 8085 MPU, it will work fine. But Z-80 has many other instructions, which are not available in the 8085.Here is the list of ... Read More

Advertisements