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

Comparison of autoboxed integer object in Java

Samual Sam
Published on 23-Jul-2018 07:20:34
When we assigned an int to Integer object, it is first converted to an Integer Object and then assigned. This process is termed as autoboxing. But there are certain things which you should consider while comparison of such objects using == operator. See the below example first.ExampleLive Demopublic class Tester ... Read More

Comparing enum members in Java

karthikeya Boyini
Published on 23-Jul-2018 07:14:42
The java.lang.Enum class is the common base class of all Java language enumeration types.Class DeclarationFollowing is the declaration for java.lang.Enum class -public abstract class Enum<E extends Enum<E>>    extends Object       implements Comparable<E>, SerializableWe can compare enum variables using the following ways.Using Enum.compareTo() method. compareTo() method compares this ... Read More

Comparing two Strings lexicographically in Java

Samual Sam
Published on 23-Jul-2018 07:07:29
We can compare two strings lexicographically using following ways in Java.Using String.compareTo(String) method. It compares in a case-sensitive manner.Using String.compareToIgnoreCase(String) method. It compares in case insensitive manner.Using String.compareTo(Object) method. It compares in case-sensitive manner.These methods return the ASCII difference of first odd characters of compared strings.ExampleLive Demopublic class Tester { ... Read More
Advertisements