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); }
@varshashinde66412 жыл бұрын
Great... Create series like this which covers small nd important topic... Waiting for next one...👍
@Ram_52 жыл бұрын
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
@jayanthipyarasani9792 жыл бұрын
Hi Naveen, could you please tell some tips to clear client round. It would be helpful
@artimandale82866 ай бұрын
Simply amazing
@sanketkale89742 жыл бұрын
The value of x is abc Naveen in this question
@SakshamKulshresthasaksham2 жыл бұрын
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.
@naveenautomationlabs Жыл бұрын
String is a non primitive data type, all the classes in java comes under non primitive data types category. It is also called derived data type or reference type which refers to an object. So yes String is a data type.
@shilpashravge5393 Жыл бұрын
thank you Naveen :)
@srinathsrinath242 жыл бұрын
Amazing explanation......
@sandeeprapolusandeeprapolu2 жыл бұрын
Good video make a series'
@Pruthvirajbyadgi2 жыл бұрын
First comment sir...youre superb sir
@niteshagrawal97282 жыл бұрын
Since abcabc is not refered by anyone , will it be removed by GC ?
@Iam_namangupta2 жыл бұрын
No, GC can not access the SCP area. It is wiped off when JVM is shutdown. Because of SCP, it is faster to use String.
@niteshagrawal97282 жыл бұрын
@@Iam_namangupta But from Java 7 SCP is the part of heap memory only
@Iam_namangupta2 жыл бұрын
Yup, SCP area is part of Heap, but is special area and JVM knows that it is not suppose to remove the constants inside it even if there is no reference to them.
@niteshagrawal97282 жыл бұрын
@CricJammer If the SCP is not garbage collected until the JVM is shut down, is there a possibility that SCP can go out of memory? or it will start to use the native OS memory?
@naveenautomationlabs2 жыл бұрын
SCP takes advantage of special treatment from the garbage collector. The garbage collector does not visit SCP with the same frequency (cycles) as other memory zones but it does.