String Immutable In Java Interview Question

  Рет қаралды 21,536

Naveen AutomationLabs

Naveen AutomationLabs

Күн бұрын

Пікірлер: 22
@naveenautomationlabs
@naveenautomationlabs 2 жыл бұрын
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); }
@varshashinde6641
@varshashinde6641 2 жыл бұрын
Great... Create series like this which covers small nd important topic... Waiting for next one...👍
@Ram_5
@Ram_5 2 жыл бұрын
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
@jayanthipyarasani979
@jayanthipyarasani979 2 жыл бұрын
Hi Naveen, could you please tell some tips to clear client round. It would be helpful
@artimandale8286
@artimandale8286 6 ай бұрын
Simply amazing
@sanketkale8974
@sanketkale8974 2 жыл бұрын
The value of x is abc Naveen in this question
@SakshamKulshresthasaksham
@SakshamKulshresthasaksham 2 жыл бұрын
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
@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
@shilpashravge5393 Жыл бұрын
thank you Naveen :)
@srinathsrinath24
@srinathsrinath24 2 жыл бұрын
Amazing explanation......
@sandeeprapolusandeeprapolu
@sandeeprapolusandeeprapolu 2 жыл бұрын
Good video make a series'
@Pruthvirajbyadgi
@Pruthvirajbyadgi 2 жыл бұрын
First comment sir...youre superb sir
@niteshagrawal9728
@niteshagrawal9728 2 жыл бұрын
Since abcabc is not refered by anyone , will it be removed by GC ?
@Iam_namangupta
@Iam_namangupta 2 жыл бұрын
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.
@niteshagrawal9728
@niteshagrawal9728 2 жыл бұрын
@@Iam_namangupta But from Java 7 SCP is the part of heap memory only
@Iam_namangupta
@Iam_namangupta 2 жыл бұрын
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.
@niteshagrawal9728
@niteshagrawal9728 2 жыл бұрын
​ @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?
@naveenautomationlabs
@naveenautomationlabs 2 жыл бұрын
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.
@jyotsnaswarnakar8345
@jyotsnaswarnakar8345 Жыл бұрын
abc
@Yuva_Kiran
@Yuva_Kiran Жыл бұрын
x
Convert String to Capitalize String in java
15:29
Naveen AutomationLabs
Рет қаралды 11 М.
Why String is Immutable and Final in Java?
19:59
Naveen AutomationLabs
Рет қаралды 88 М.
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 134 МЛН
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 108 МЛН
What is String Immutable || Why String Object Is Immutable In Java (Hindi)
17:36
Why String is Immutable | Java Tutorial
13:27
Naresh i Technologies
Рет қаралды 87 М.
OCJA(1Z0 - 808)|| Important Conclusions about String Immutability
15:04
Durga Software Solutions
Рет қаралды 25 М.
String Manipulation in Java - Interview questions - Part -7
25:21
Naveen AutomationLabs
Рет қаралды 112 М.
30-Day SDET Technical Interview Preparation Plan | Naveen Automation
25:12
Naveen AutomationLabs
Рет қаралды 16 М.
Java Strings are Immutable - Here's What That Actually Means
7:06
Coding with John
Рет қаралды 622 М.
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 134 МЛН