Java String interview Questions and Answers with example| Immutable | Most Asked | Code Decode

preview_player
Показать описание
In this video of code decode i.e. Java String Interview Questions and Answers for freshers and experienced.

Udemy Course of Code Decode on Microservice k8s AWS CICD link:

Course Description Video :

We have taken some most commonly asked Interview questions along with their answers

This string Interview questions are asked in almost every interview of Java whether it would be freshers java interview or experienced java interview

Please watch this video of Most Asked String Interview Question as it cover very important string interview questions and answers.

Relevel link :

What are the different ways to create string objects?

String objects can be created in two ways:

Using the ‘new’ operator.
Using double-quotes.

String S1 = new String("code");

String S2 = "decode";
When the String is created with the double quotes, JVM searches it for in the string pool; if the same value is found, it returns the reference to that String else creates a new object with the new value provided.

In the other case, if the String is created with the ‘new’ operator, then JVM creates a new object but not in the string pool. If we want to create the object in the string pool, we can use the intern() method.

What is a string constant pool?

The memory space allocated in the heap memory to store the string literals is called the string constant pool.

No two string objects can have the same value in a string constant pool.

Why is Java provided with String constant pool as we can store the objects in heap memory?

String constant pool provides the facility of reusability of the existing string objects.

When a new string object is created using the string literals, then JVM first checks in the pool if this String already exists or not.

If it exists, then it will reference the existing String rather than creating a new object.

This will help in the speeding up of the application and also helps in saving the memory as no two objects will have the same content.

Subscriber and Follow Code Decode

#codedecode #javainterviewquestion #stringinterviewquestion
Рекомендации по теме
Комментарии
Автор

I am mother of 2 year old toddler and 4 years gap in software field. Because of ur videos I have cracked interviews. Thanks a lot 🙏

anooppressboltme
Автор

I have cracked multiple interviews purely based on your videos only. Be it core java, streams, spring, boot, hibernate. Since then I have been watching your videos as soon as they are uploaded and have recommended my friends to do so. I think what offer I have earned today is entirely based on your efforts and credit goes to you.Very grateful to you mam 🙏🙏and excited to watch your new initiatives. Please keep going.

kalekar
Автор

I never comment on yt videos but I want to say I became a fan of your teaching... I'm on a spree watching your videos and it is helping me a lot in my professional upskilling. Thanks a lot Mam! ❤❤

kalavaguntahridayasaivalli
Автор

Very Well explained !.


Just want to add for last example, when you do concatenation of s1 + "decode" , it actually creates a new object for "decode" and than "CodeDecode", after the 2nd line there will be 3 objects in string pool.

Thanks for reading, correct me if you think differently.

Sunilkumar-jnci
Автор

Thank you for your Great work!! These videos are short and to the point and good to brush up concepts before interviews, keep up the good work!!

manishagarwal
Автор

please cover the most asked string coding interview questions.
Your content is awesome!!
Thanks for the hardwork

suyashgupta
Автор

Awesome. Please make us more strong to clear any java interview question without going to any other channels.

akashsaha
Автор

Your concepts are very clear.. You are making really great videos for everyone. Pls do make the video on string coding questions as well. I want to suggest one example as well which i have been asked in my interview. I had to replace the vowel with the number of occurrences let me explain with example... Suppose there is a string as opportunity so i have to replace o with 2, u with 1 and i with 1 as well because, as you can see that the vowel has been replaced with the number of occurrence, i was also asked to iterate an string using map for this logic.

These type of questions can also clear many concepts and help to think big and build the logical thinking. I belive you will be making a video on that as well with great examples.

Thanks for making such a great content for everyone. Really appreciated. 😄😄🙌

harshsanmukhani
Автор

Excellent video! Just to the point and lots of important learnings to take away from this video! 👍👍

gautamagarwal
Автор

This is really really helpful. Got all my doubts cleared related to Strings in java with this one.

vasundharachintha
Автор

hi mam..what a clarity! Am one of ur great fan...love to study your videos...
Please add string programming interview qwestions also..

priyankau
Автор

Excellently covered end to end complete string concept...

nagapradeepvankayala
Автор

Very very Nice Explanation mam. Please make series of java interview questions
Array. Loops. Oop and collection framwork.

firdousbelim
Автор

One que: if unattended 'code' created while creating obj then what is the use of unattended 'code' where we can use ?

testingvinod
Автор

Thank You so much ma'am . Can't really appreciate you guys enough for all the efforts that you put in . Helps so so much for interviews, pretty much looks like interviewers too just pick up questions from your channel 😅 . Thank you again and as usual looking forward to many more videos .. 🙂

shwetabhat
Автор

Daily upload karo core java interview questions

ArjunSingh-isbg
Автор

Appreciate your way of explaining everything is really unique and easily understandable

shyamalirani
Автор

thx a lot for explanation, watched a bunch of videos, your's was the best

maksimmakarov
Автор

Thank you..very informative, helpfull tutorial with easy explanation and best examples 👍👌

jainamdesai
Автор

Appreciate your way of explaining everything is really unique and easily understandable....Thank YOU😇

mayurishinde