1.

Difference between Array and Object.

Answer»
  • An object REPRESENTS a thing with characteristics (called a PROPERTY), whereas an array CREATES a list of data and stores it in a single variable. USING brackets and dots, we can access, alter, and delete items from objects, while a variety of built-in methods and zero-based indexing allow us to access and modify items in arrays. We can iterate over object properties and array items using various different loops (e.g. for, for…in, for…of, forEach()).
  • All Java objects are DYNAMICALLY allocated on the heap. Unlike C++, where objects can be allocated in memory either on Heap or on Stack. When we use the new() method in C++, the object is allocated on the heap, otherwise on Stack if not global or static.


Discussion

No Comment Found