I read a lot about String Literal vs String Object. I read that String literal is stored in a String pool and String object will create an object in the heap. I'm quite confused in an instance variable of a class that is initialized using "".
class A {
private String aStr = "ASTRING";
}
Will aStr
will be added to String pool or will it create an object in the heap?