Question: Can anyone please explain to me exactly what happens internally when we compile and run the below code...

```
class ObjTest{
    public static void main(String [] args){                    
        while(true){
            String str = new String("Hello");
        }
    }
}

```

Answer: 
Each iteration of ths infinite loop creates a new String instance. 

The instance created in the previous iteration becomes eligible for garbage collection, so whether you end up with an out of memory error or not depends on whether the garbage collector frees those old instances quicker than the loop creates new ones.
"while" execute the block statement while the condition is true.

And you are passing "true" making the condition be always true.

It will never stop