Tag: java challenge

array object reference

Arrays and Object Reference Java Challenge

Arrays are objects in Java. Variables in Java actually stores references to the object instead of the real object. When we pass an object reference to a method we are changing the object that is in the heap of the memory. Considering the explanation...

String pool challenge

Java Challenge #1: String Pool

Every time we create a different String, an object is created in the pool. How many objects were created in this situation? Try to solve this challenge before seeing the answer below. Answer: 3 Strings and 1 StringBuilder are created in the...