Array in Java

An array is a collection of similar data types. It contains the values of homogenous or similar type. It is also known as static data structure because size of an array must be specified at the time of its declaration. It can contain values of either primitive or reference type. It gets memory in heap […]

Share this article on

Widening and Narrowing in Java

In Java, assigning one primitive type to another primitive type is possible if they are related primitives Example: We can assign long to int , short to int and float to double etc. Way of assigning one type of primitive to other primitive type is classified as 2 categories 1.Widening(Auto or implicit) 2.Narrowing(Explicit) 1.Widening In […]

Share this article on
Next >