Middle+
What are the characteristics of testing microservices at the component and module level compared to testing monolithic applications?
sobes.tech AI
Answer from AI
A reference array is an array that stores references (pointers) to objects, rather than the objects themselves. Each element in the array holds the address of an object in memory.
Key features:
- Stores references: Elements are addresses to objects.
- Object creation: Objects are created separately using
new. The array itself is created withnew. - Default value: For reference types, default is
nullif not assigned. - Dynamic size: The array size is fixed after creation, but objects can be dynamic.
Example in Java:
// Creating a reference array of String
String[] names = new String[3];
// Assigning references
names[0] = new String("Alice");
names[1] = "Bob"; // String literals also create objects
// Default value for uninitialized elements is null
// Accessing objects via references
int lengthOfFirstName = names[0].length();