ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Can String Buffer has a String constant pool in java?

user-image
تم إضافة السؤال من قبل Mohd shahnawaz khan , Associate Project , Cognizant Technology Solution
تاريخ النشر: 2013/11/21
Vivek Dudani
من قبل Vivek Dudani , Software Engineer / Senior Software Engineer , Mastercard

The answer is no. The whole idea behind using String Buffer is not to use string pool as that will make it behave like a normal String class if it uses string pool. String Buffer creates a new object in Heap.

pardeep kumar
من قبل pardeep kumar , Senior R & D Engineer , Mavenir Systems

No,  String buffer do not have a String constant pool because String buffer is mutable class.

Where as String has constant pool because it is immutable in java.

المزيد من الأسئلة المماثلة