Get Union and Intersection of Two TreeSet in Java

Shiva Keerthi
Updated on 26-Jun-2024 12:49:10

457 Views

TreeSet is a class that implements Set interface in Java. In TreeSet the elements are stored in sorted order as it is implemented internally using a sorted balanced tree called as binary search tree. The elements in the TreeSet are stored in ascending order by default. Union of sets contains all the elements from both sets. Intersection of sets contain all the elements which are commonly present in both sets. In this section, we will be discussing about how to get the union and intersection of two TreeSet using Java. What are the Union and Intersection of Sets? ... Read More

What is strtok() Function in C Language

Bhanu Priya
Updated on 25-Jun-2024 23:21:10

4K+ Views

strtok_r() function in C language The strtok_r() function is similar to the strtok() function. The only key difference is that the _r, which is called as re-entrant function. A re-entrant function is a function which can be interrupted during its execution. This type of function can be used to resume execution. Because of this fact, re-entrant functions are thread-safe, means they can safely be interrupted by threads without any harm. strtok_r() function has an extra parameter called the context. so that function can resume at the right place. Syntax The syntax for strtok_r() function is as follows: // ... Read More

Composite Key in RDBMS

Amit Diwan
Updated on 25-Jun-2024 16:57:43

5K+ Views

A primary key having two or more attributes is called composite key. It is a combination of two or more columns.An example can be −Here our composite key is OrderID and ProductID −{OrderID, ProductID}Let us see another example −StudentIDStudentEnrollNoStudentMarksStudentPercentageS001072172257090S002072179049080S003072176644086Above, our composite keys are StudentID and StudentEnrollNo. The table has two attributes as primary key.Therefore, the Primary Key consisting of two or more attribute is called Composite Key.

Referential Integrity Rule in RDBMS

David Meador
Updated on 25-Jun-2024 16:43:22

10K+ Views

Referential Integrity Rule in DBMS is based on Primary key and Foreign Key. The Rule defines that a foreign key have a matching primary key. Reference from a table to another table should be valid.Referential Integrity Rule example −EMP_IDEMP_NAMEDEPT_IDDEPT_IDDEPT_NAMEDEPT_ZONEThe rule states that the DEPT_ID in the Employee table has a matching valid DEPT_ID in the Department table.To allow join, the referential integrity rule states that the Primary Key and Foreign Key have same data types.

Future of RDBMS

Amit Diwan
Updated on 25-Jun-2024 16:32:16

792 Views

BigData and NoSQL are the choice for database solutions nowadays, but that does not mean the crucial features of RDBMS will die. Since 90% of the world data produced in last some years, therefore the need for RDBMS will not end in the near future.The RDBMS market is incrementing with 9% annual growth, as stated by Gartner, a research company. RDBMS is meant to handle organized data. NoSQL and Big Data maybe a preferred choice, but the importance of RDBMS will not end in near future.Managing data on a large scale now needs technologies like Big Data, but RDBMS still ... Read More

Difference between SAP ERP System and DBMS

Samual Sam
Updated on 25-Jun-2024 16:17:28

3K+ Views

DBMS or Database Management system is basically the tool/interface required to manage the database.  For example, SQL server or a tool like MYSQL workbench is a DBMS. A DBMS is mainly used by or designed for technical people.ERP (Enterprise Resource Planning System) is a complete system with one database and number of function modules and has a number of inputs and output interfaces to be used by everyone. For example, there can be a user interface for customer or business people, another for technical people with various skills.So basically we can say that DBMS can be a subset of ERP.Read More

Get TreeMap Key, Value or Entry Greater or Less Than Specified Value in Java

Shiva Keerthi
Updated on 25-Jun-2024 14:53:17

1K+ Views

A TreeMap is a class provided by Java that implements Map Interface. It is a collection of key-value pairs and the key-value pairs in TreeMap are stored in sorted order based on key values. An Entry is defined as a key-value pair in a TreeMap. In this article, we will look in detail how to get TreeMap key-value pair or entry greater or less than the specified value. Methods Used Now, we will be looking into some of the inbuilt methods and their functionality of TreeMap which are used in this particular article. higherKey() − This method is ... Read More

Convert Boolean to Integer in Java

karthikeya Boyini
Updated on 25-Jun-2024 14:39:45

13K+ Views

To convert boolean to integer, let us first declare a variable of boolean primitive. boolean bool = true; Now, to convert it to integer, let us now take an integer variable and return a value “1” for “true” and “0” for “false”. int val = (bool) ? 1 : 0; Let us now see the complete example to convert boolean to integer in Java. Example public class Demo {    public static void main(String[] args) {       // boolean       boolean bool = true;       System.out.println("Boolean Value: "+bool);       int val = (bool) ? 1 : 0;       // Integer       System.out.println("Integer value: "+val);    } }OutputBoolean Value: true Integer value: 1

Find the Lost Number in Java

Shiva Keerthi
Updated on 25-Jun-2024 14:37:14

469 Views

Lost Number is the number which is missing from a continuous stream of elements or in an Array. In this section, we will discuss the various approaches to find a lost number in a stream of elements using java programming language. Example for a lost number in an array Lost number is a number which is missing from a continuous sequence of a numbers in an array. Example 1 Consider an array: arr=[1, 2, 3, 4, 5, 6, 8] In the above array ‘arr’, 7 is missing, so 7 is the lost number Example 2 Consider an array: arr=[1, ... Read More

Get System Motherboard Serial Number for Windows and Linux Machine

Shiva Keerthi
Updated on 24-Jun-2024 17:22:24

1K+ Views

Motherboard Serial Number is an id assigned to the motherboard of a computer. It is generally used to track the computer system and also to identify when the system is lost or stolen. In this section, we will be discussing different approaches to find the Motherboard Serial Number for Windows and Linux machines using Java programming language. Motherboard is a very crucial part of a computer. It is the backbone of the computer. All the components in a computer communicate through the motherboard. Motherboard helps in determining the factors like the amount of RAM we are going to ... Read More

Advertisements