Conversion of Array To ArrayList in Java

karthikeya Boyini
Published on 23-Jul-2018 08:26:30
We can convert an array to arraylist using following ways.Using Arrays.asList() method - Pass the required array to this method and get a List object and pass it as a parameter to the constructor of the ArrayList class.Collections.addAll() method - Create a new list before using this method and then add array ... Read More

ConcurrentMap Interface in java

Samual Sam
Published on 23-Jul-2018 08:17:30
A java.util.concurrent.ConcurrentMap interface is a subinterface of Map interface, supports atomic operations on underlying map variable. It has got and set methods that work like reads and writes on volatile variables. That is, a set has a happens-before relationship with any subsequent get on the same variable. This interface ensures ... Read More

Entity Relationship Participation in Database

Kristi Castro
Published on 23-Jul-2018 09:02:07
In a Relationship, Participation constraint specifies the existence of an entity when it is related to another entity in a relationship type. It is also called minimum cardinality constraint.This constraint specifies the number of instances of an entity that can participate in a relationship type.There are two types of Participation ... Read More

Compound assignment operators in Java

karthikeya Boyini
Published on 23-Jul-2018 08:06:01
The Assignment OperatorsFollowing are the assignment operators supported by Java language −OperatorDescriptionExample=Simple assignment operator. Assigns values from right side operands to left side operand.C = A + B will assign value of A + B into C+=Add AND assignment operator. It adds right operand to the left operand and assigns ... Read More

Ternary Relationship in Database

Kristi Castro
Published on 23-Jul-2018 09:07:17
In Ternary relationship three different Entities takes part in a Relationship.Relationship Degree = 3For Example: Consider a Mobile manufacture company.Three different entities involved:Mobile - Manufactured by company. Part - Mobile Part which company get from Supplier. Supplier - Supplier supplies Mobile parts to Company.Mobile, Part and Supplier will participate simultaneously in a ... Read More

Binary Relationship in Database

Kristi Castro
Published on 23-Jul-2018 08:53:32
A Binary Relationship is the relationship between two different Entities i.e. it is a relationship of role group of one entity with the role group of another entity.There are three types of cardinalities for Binary Relationships −1. One-to-One2. One-to-many3. Many-to-ManyOne-to-OneHere one role group of one entity is mapped to one ... Read More

One-to-Many Unary Relationship in DBMS

Kristi Castro
Published on 23-Jul-2018 08:38:12
A One-to-Many Unary Relationship is the association with the same entity between the same instances represented by different role groups.Consider the relationship between Managers and Employees.The two different Roles in this relationship are- Managers and Employees. Only few Employees take the role of Managers within an organization while everyone working ... Read More

One-to-One Unary Relationship in DBMS

Kristi Castro
Published on 23-Jul-2018 08:20:41
A One-to-One Unary Relationship is the association with the same entity between the same instances represented by same role group.Above figure represents a set of married persons with the relationship MARRIED_TO. Each person is married to only one and only one person in the group.In One-to-One Unary we have three ... Read More

Compilation and execution of Java Program

Samual Sam
Published on 23-Jul-2018 07:44:30
Let us look at a simple code first that will print the words Hello World.ExampleLive Demopublic class MyFirstJavaProgram {    /* This is my first java program.        * This will print 'Hello World' as the output        */    public static void main(String ... Read More

Comparison of double and float primitive types in Java

karthikeya Boyini
Published on 23-Jul-2018 07:32:56
If we compare a float and a double value with .5 or .0 or .1235 (ending with 5 or 0), then == operator returns true, otherwise it will return false. See the below example.ExampleLive Demopublic class Tester {    public static void main(String[] args) {       double d1 ... Read More
Advertisements