Maruthi Krishna has Published 870 Articles

Can we make Array volatile using volatile keyword in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Jul-2020 13:22:36

2K+ Views

The volatile modifier indicates the JVM that the thread accessing a volatile variable should get data always from the memory. i.e. a thread should not cache the volatile variable.Accessing a volatile variable synchronizes all the cached copied of the variables in the main memory. Volatile can only be applied to ... Read More

Where does Array stored in JVM memory in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Jul-2020 13:14:30

5K+ Views

Array is a container which can hold a fix number of entities, which are of the of the same type. Each entity of an array is known as element and, the position of each element is indicated by an integer (starting from 0) value known as index.Exampleimport java.util.Arrays; public class ArrayExample ... Read More

Can we store objects in an array in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Jul-2020 12:45:01

11K+ Views

Array is a container which can hold a fix number of items and these items should be of the same type. Most of the data structures make use of arrays to implement their algorithms. Following are the important terms to understand the concept of Array.Element: Each item stored in an ... Read More

Can you change size of Array in Java once created?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Jul-2020 12:43:37

8K+ Views

An array is a data structure/container/object that stores a fixed-size sequential collection of elements of the same type. The size/length of the array is determined at the time of creation.The position of the elements in the array is called as index or subscript. The first element of the array is ... Read More

What is an anonymous array and explain with an example in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Jul-2020 12:35:23

2K+ Views

An array is a data structure/container/objectthat stores a fixed-size sequential collection of elements of the same type. The size/length of the array is determined at the time of creation.The position of the elements in the array is called as index or subscript. The first element of the array is stored ... Read More

How to convert integer set to int array using Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Jul-2020 12:34:00

11K+ Views

A collection object in Java is the one which stores references of other objects in it. The java.util package provides the classes and interfaces for collections. There are four main collection interfaces namely Set Lists, Queues, Maps.Set − The set object is a collection which stores group of elements, it grows ... Read More

Are the constructors in an object invoked when de-serialized in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Jul-2020 12:31:58

1K+ Views

In Java, serialization is a concept using which we can write the state of an object into a byte stream so that we can transfer it over the network (using technologies like JPA and RMI).To serialize an object −Make sure the class implements the Serializable interface.Create a FileOutputStream object representing ... Read More

Different ways to traverse an Array in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Jul-2020 12:28:53

16K+ Views

In general, arrays are the containers that store multiple variables of the same datatype. These are of fixed size and the size is determined at the time of creation. Each element in an array is positioned by a number starting from 0.You can access the elements of an array using ... Read More

What are the different ways of copying an array into another array in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Jul-2020 12:26:07

808 Views

In general, arrays are the containers that store multiple variables of the same datatype. These are of fixed size and the size is determined at the time of creation. Each element in an array is positioned by a number starting from 0. You can access the elements of an array ... Read More

What are the different ways to iterate over an array in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Jul-2020 12:21:33

19K+ Views

In general, arrays are the containers that store multiple variables of the same datatype. These are of fixed size and the size is determined at the time of creation. Each element in an array is positioned by a number starting from 0.You can access the elements of an array using ... Read More

Advertisements