String Immutable In Java Interview Question

preview_player
Показать описание
String Immutable In Java Interview Question

Schedule a meeting in case of any queries/guidance/counselling:

~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:

Follow me on my Facebook Page:

Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:

Naveen AutomationLabs Paid Courses:
GIT Hub Course:

Java & Selenium:

Java & API +POSTMAN + RestAssured + HttpClient:
Рекомендации по теме
Комментарии
Автор

One small correction in the video, when we concatenate x and y it will generate a new String in heap memory not in SCP. So in this example, "abcabc" will be stored inside the heap memory.

this is the internal implementation of concat() method in java:

Concat method:
public String concat(String str)
{
int otherLen = str.length();
if (otherLen == 0) {
return this;
}
int len = value.length;
char buf[] = Arrays.copyOf(value, len + otherLen);
str.getChars(buf, len);
return new String(buf, true);
}

naveenautomationlabs
Автор

Great... Create series like this which covers small nd important topic... Waiting for next one...👍

varshashinde
Автор

Hi Naveen,


Can you please tell me solutions for the question in the below.


Split a String but don't split when character repeats.. input s="aHHHbYY";

Out put would be like output:[a, HHH, b, YY]


Thanks in advance.



Ragards,

Kanvitha

Ram_
Автор

Hi Naveen, could you please tell some tips to clear client round. It would be helpful

jayanthipyarasani
Автор

Very helpful video but just one correction, at 7:51 you mentioned Strings are the most commonly used data type. But it is not data type, it is class. We can call it data storage but not data type.

SakshamKulshresthasaksham
Автор

The value of x is abc Naveen in this question

sanketkale
Автор

Since abcabc is not refered by anyone, will it be removed by GC ?

niteshagrawal