okay great bring awesome so the strength is looking awesome today because it says that every weekend that is Friday means rest day we have to take a rest yes Indian psychology and it's not only for this batch this is for all the batches you go to the other batches also this is how the strength looks like so sometimes you know when I come to your class or any other classes that on Friday looking at the strength of the class I remember one person and his name is Michael Phillips you know him he's an American swimmer and he known as a golden fish of this world how many of you know him only few of you shocking okay anyhow so this guy he is from America he known as a golden fish back then in 2008 there was Olympics in Beijing he won eight gold medals in Olympics how many gold medals eight eight previously in 2021 there was Olympics in Tokyo Japan correct how many gold medals India won one that to from one guy who is that n jro so people were going Gaga about him oh n Chopra one gold medal one gold medal very good very good you can't even imagine eight gold medals by one individual for his Country 2008 after 4 Years 2012 London Olympics six gold medals again means in the span of just you know 8 years he has won 40 gold medals for his country my friends and now the question is how he is able to do it I was looking at his interview and he told that every single day I was in the swimming pool each and every day 365 days whether it is my birthday whether it is Christmas someone died I never care I went to the swimming pool swimmed each and every day for each and every day for eight years and what is the result 14 gold medals for his country not only that there's one guy whose name is Hussein bolt you know Hussein bolt cheah correct he has won three gold medals in 2008 Beijing Olympics three gold medals in 2012 London Olympics three gold medals in 2016 Rio Olympics hatrick three gold medals every year I mean every Olympic and if you go and ask them how you able to achieve it every single day 365 days I am on the track running each and every day it's not only that the greatest Sportsman the world has never seen Muhammad Ali you know Mohammad Ali is again he's from USA see if you look at his hands you know the boxing hands you're unable to see his hands that much faster his hands wear now someone went to him and asked how you able to do that he told every single day I was in the boxing ring that is I able to do it here are the greatest of people who never cheated their hard work they never cheated their discipline and what is the result success now here we are five days you attend the classes no no Monday Tuesday Wednesday Thursday Friday means what weekend weekend means what maah enjoy and these are such students after the course they'll come to us and they will ask where is the placement and we will tell them where is the placement look at your weekly test look at your attendance look at your mock how you able to make you get placed you're unable to attend five classes or five days in a week what you achieve in the life but you need 12 lakh perom 15 lakh perom 20 lakh perom but work you do no I will sleep in the PG you'll dream oh company Amazon Walmart in the company there is a Kitchen Buffet there is you know micro kitchen there's a cab coming oh cab is coming all of this is there in the dreams you dream it and this dream should get fulfilled what you should do you should do the work right hard work you should do not doing anything something great should happen in your life how is that possible not at all possible again you are here 30,000 you took thrown at us told Place me that is what your previous trainer your roit are already told that you work hard you get it you'll not do anything you not get it as simple as that and I'll show I will show you so many examples of my students wherein they got placed within two to three months do you know what's the package 10 lakh 12 lakh 15 lakh I'll give the LinkedIn profiles of those students and ask them that what they did two months recently in Feb batch there's one student known as prmish he got pissed for 10 lak Pana he came in the month of February March April April starting he got placed within two months you just go and asked them how is able to do it I asked him he told that 6 hours I used to work every single day no matter what I haven't missed any of the classes in this two months of course I haven't you know missed any assignment in the thigh that is why what is the result 10 lakh per just in the span of two months like that I will show you so many students out there where in now also they are finding a job they unable to get it why no skill no skill no job more skill more salary medium skill medium salary no skill no salary that's it now you decide you want more skill more salary no skill no salary you'll be finding you know uh job job job job and again us as Indians we have always this habit we are doing wrong our fingers are not here asking why it went wrong your hand is like this your finger is like this you're pinp pointing to this why did not God placed in the college College was like that teachers were like that no skill means your finger was always like this now take the same finger hold at you what you have done that was the problem now you came here for what reason to get job as soon as possible what are you doing here you are doing the same thing boss the problem is not with the world the problem is with you and your mindset and now what happened previously the same thing is going to happen now also because in the the past what you do that is how the future looks like in the past what you did no skill in the future what is there no job now this is the present in the present what you should do take the skill future how it will look like you have a job now also no skill future is clearly visible no job understand you're here you have AC there in the most comfortable place say in your college forget about a fan was there how much you paid one year there H you had this kind of a board there where in everything in visualized way we are teaching did you had there no see if I want I can put one board here and teach any day students will come because this is what we've been doing from long long time why we did it it's for you you don't have skill you to make you more skill we build it to get that board you know just 5,000 is required you know from there to there 5,000 white boat some markers 150 rupees that's it we build this do you know what's the cost of this 10 lakh Rupees 10 lakh with that all that system and all just to set up this we need some 30 40 lakhs you know this 30 40 lakhs just to set up this why we have to have this camera there why we have to give recorded session why it's for you all of this you're not having previously now we are giving all of this to you at this point of time why to get you a skill to give you a skill to take the skill and get placed as soon as possible they tell me in your college did you have th platform to Cod did you have any platform to Cod yeah we are giving it to you for what you should get that skill as soon as possible get placed as soon as possible all of these recorded videos why we should give why why see and that do we are not limiting yourself we are telling you take this access give it to anyone there can you give it tell me can you give it no you can give it you can give the access to anyone because we are not here to you know earn something great there if earning is the thing I'll be working in it there I'll be working in it but why we are here we want to Revolution bring the revolution into the system no one is doing it there let us do this revolution that is why we are here these videos we are creating giving it to you why okay if the students are getting doubt they can watch it they can execute it okay after 4 months I think they can't remember it to revise it again they can watch the video not one time two time 200 times you watch it oh your friends Papa they don't have money to come come into these institutes don't worry give them the access you tell them hey this is the skill you learn are they giving money no give them the access I'm only telling you give them the access so I'm really appreciate that you guys are here in the day that is Friday weekend but the other students you know I feel very pity for them because now they're bunking correct and let me tell you in the next coming 6 months this is how the class will look like and during your advanc Java this will exactly become half I'm telling you this will become exactly half in Advan Java when we go to the springs you know that again half will become next half means out of all of you only 25% will be the students will be sitting why again no revision no revision how you'll understand advanced concepts because what we are learning is core Java do you know what is core this is core if core is strong enterre body is strong if core Java is strong enter Java is strong that is why the name core Java you know core Java you'll understand Advanced Java and Frameworks like this my students are there I'll show you you just go and ask them is code Java is Easy Advanced Java is easy Frameworks easy they'll all always tell you Frameworks is easy about this Advanced Java is easy code Java itself somewhat you have to you know code a lot they know code job perfect that is why they're telling Frameworks and Advance Java easy go and ask them but you ask the students who will not come to the class of Frameworks they will tell no Frameworks is very difficult then you ask them on simple code Java question what is Constructors they unable to EXP explain to you code Java Constructors only you don't know how come you'll understand Frameworks think about it what do you want to do okay anyhow so yesterday I have started with a brand new concept correct the Brand New Concept name is string I told you string is a collection of characters enclosed within double quotes strings or objects in Java there two types of strings are there in Java one is immutable next one is mutable immutable strings are such strings which are non-changeable mutable strings are such strings which are changeable now mutable eliminated at this point of time immutable string to create immutable string I need one class because what are strings objects for objects what do you need class to create immutable string object which class is required which class string class class is required and string is an inbuilt class in Java and everything this we have seen where the strings are stored in the Heap segment where in the Heap segment there are two things there string constant pool Heap area when it will get stored in the string constant pool when you don't use new keyword when it will get stored inside the Heap area when you use new keyword so all of this we have seen I think one example we have seen correct so let us continue with our next program and if you ask me what is that please watch it great so this is how my next program looks like great we have a stack segment Heap segment string constant pool and Heap area I'm having my code segment as well this is how it looks like we have a beautiful class here good we have the main method awesome and this is how my Java looks like good I'll give there yes one and I will tell string type this is how it will look like good I'll will create one more string there this is how I create I will create this string by using new I will tell new new what sir string like this I'll open this close this put semicolon inside this you should give there one string and that is what I'm showing you and whatever he's giving me I want to give one reference to it and that reference is yes to you should be telling what type it is it is string type these are my two instructions in my main method how it will execute it will come to the main method assignment right side something within double quotes who is he he is a string how you creating the string without new without new means where the string is getting created is it string constant pool he area string constant pool that is why there's a brand new object getting created brand new object brand new address that is what I'm showing you and this address will be given who will catch it yes1 S1 is a reference variable its space here in the stack segment this address he will catch it in this way and 100% he will refer to this object first object is ready you'll go to the next instruction he will see there is one more Java and this is within double quotes he is a string how you have created with the help of threel beautiful word new new string I should create where you can see new new means what Heap area this is string constant pool this is Heap area in Heap area there will be the brand new object in the Heap and that is what I'm telling so this is a brand new object brand new address like this and 100% this address is taken and given who will catch it yes to yes2 is my reference variable yes2 will have this, and 100% it will start refering to this object those are the two instructions this is how it will look like in the memory and I want to show you now literally S1 and yes2 is having 1,00 and 2,000 I want to show you this really sir let me show you so I'll get my eclipse for you this is how my Eclipse looks like I want two statements there let me type two statements to start with it is string S1 equal to within double quotes it is Java after this I I will turn it as string S2 equal to I will turn it as new new what sir string like this and here within double quotes you should tell it inside within double quotes I will tell it as Java I'll tell here put semicolon those are two statements this is how it will look like I want to compare this S1 and S2 now how you will do come here I will tell yes one good are you equal to one guy who is that yes do if both of you are same then you should do something what is that simply you should not give like that then how should I give sir I if if you should tell open the simple bracket close it inside this you should put it if this is true you should do this if that is false you should do something else if this is true what you should do I want to print one statement what statement equal like this if this is not true 100% else part should execute that is unequal that is what I'm showing you now tell me what output you will get in this case you can see two statements that is how it will work let me come here if go inside what is s1,000 what is S2 2,000,000 2,000 are they same no no in Java is what false false means this part should not execute else part should execute this is the else part what you have unequal that output you will get really sir let me show you if in case I save it and execute it you can see unequal this is my memory that is my output understanding great tell me my friends what you compare it here yes one yes2 address where these addresses are present in stack but before stack it is stored inside S1 and S2 what is S1 and S2 references correct means to compare these references you have used this guy correct but now I don't want to compare these references instead I want to compare the values who are the values he's a value he is a value I want to compare these values now how can I do it that is what I'm showing you go watch it what I will do I'll close this console you want to compare 1,000 2,000 S1 S2 you should tell double equals but I want to compare the values then what should I do sir very simple what's this double equals you should remove then what should I tell tell me Java Java means what S1 only see S1 only refering this Java who is that S2 S1 and S2 is required you should not removed then what should I tell sir you should tell it as dot dot what sir equals like that you should tell it okay sir how this will work now watch it this is yes one tell me yes one is refering to whom Java equals yes2 yes2 is refering to whom Java Java equals Java true or false this is true execute him what is the output equal equal good I'll save this and execute if I do it you can see this is what output I'm getting understanding great I'll close this conso what I will do instead of capital J I'll give small J what is the output equal unequal unequal unequal why both of them are Java only right okay see if you look yes one is this Java yes to is this Java both are same no maybe for human being Java and Java both are same but for Java both are different why is different this is lower case this is upper case both of them are different for Java why sir Java is case sensitive programming language not understanding Let me Give an example you have a beautiful device in your hand that is mobile speaking like this and you're walking and there's one stranger just collide with him like this and this guy will turn around and tell hey you idiot you here like this oh idiot you told is it upper case or lower case tell me will you tell like that no we are what human beings we are case insensitive idiot and idiot is same for us idiot if you tell we'll understand oh idiot now watch it hey you idiot to whom you are telling Java you telling now Java is telling that idiot you told is it upper case or lower case please tell me because Java is case sensitive we are case insensitive that is why he's thinking this J is different this J is different I'm case sensitive that is why the output you will get is unequal because both Javas are different than the that now what I want to do is I want to tell to my Java hey Java behave like human being means you should be case insensitive behave like a human being how can I tell it very simple equals if you tell he will behave like case sensitive I will tell you equal but you ignore the case like that equal ignore the case now you save it and execute it Java will be case insensi you not you're getting equal there understanding very good with this I'll close this console and go for the next one what is that let me show you what's this this is my previous program let me remove it oh I want it back please come back again we have stack we have Heap all the story you know we have Cod segment we have this template program we have a class we have a main method we have some instructions inside this first instruction new new what strain good I'll open this close this inside this I will give Java for him I will give a reference the reference I want to give is this what's that sir yes one and I will tell what type it is what type it is string I want to create one more instruction this is how it will look like we have a new string and I'll open that close this Java is a yes to it is string now let us see how it will work what's this your main method execution is starting assignment Java is a string string means in the Heap segment how you have created it using new when you told new where it should get created in the Heap area because new you have used it there a brand new object brand new reference also you have it will be collected it will be collected by whom yes1 yes1 will be having thousand he will start referring to that object first instruction is done and dusted next instruction assignment Java string again why you used what you have used here new new means where the brand new object in the Heap area but in the Heap area already Java is there will again one more job will get created yes or no what do you think yes or no some of you are telling yes some of you are telling no watch it tell me my friends Heap area is having one property what is that property new keyword store it here one more property duplicates are allowed you can store the duplicates here Java one more Java you can create no problem that is why one more Java will get created like this one more Java means one more address one more address means one more reference and one more reference means there will be a reference that is address inside that he'll be referring to this this is how it will get created I want to see literally this is how it will look like using my program what's this I'll get my eclipse for you this is how my Eclipse looks like this was the previous program I don't want to do all of this I'll just eliminate now what I will do I'll change this program now actually speaking that is not how it will look like new string I'll open this close this I'll put semicolon you should come inside within double quotes you should tell it as Java two instructions this is how it will look like I don't want to compare values I want to compare references what you will do what do we do very good who are the references yes one who is next guy yes two what you comparing references what you should use double equals very good this is how you should tell it and that is what I'm showing you now what is s1,000 what is S2 2,000 are they same no no no means what false false means is this part will execute else part will execute else part what is the else part unequal and that is the output you will get unequal now it's not the references I want to compare the values how you compare the values references means double equals values means dot equals that is what I'm telling if in case you save it and you execute it you can see both are equal this is your next case let us go for the next program what's that let me show you what's this okay let me get this back stacked and Heap good and now we have code segment as well and we have the program some students might be thinking that sir we understood can you not proceed further no because I have to teach you all the cases means new without new both the sides new one without new next new because in interviews they'll ask you these kind of questions only they'll give you two instructions tell me what is the references here you should really really tell thanks to this guy because you're able to understand the concept it is because of that guy who is a memory diagram it's not only Java you take any programming language you're understanding from the memory perspective you can understand the deeper and the deepest of levels understand from a memory perspective that is why it's my duty to give all the case studies and the programs please watch it I'll get my program Java is the first string I'll give the reference there the reference is yes one I'll tell the type also string we have Java again we have yes2 and I will tell the type as what string good tell me first instruction executes where it will get stored string constant pool Heap area where very simple new have you used no no new means string constant pool where is string constant pool string constant pool is here there is a Java getting created like this brand new address good who will collect it S1 this is my S1 S1 will have thousand and it will start refer to this object great how many times will come okay Java next statement is very important assignment right side Java my question to you is with new without new without new without new means string constant pool Heap area string constant pool but already Java is there duplicates are permitted not permitted what it will do it will take the address and give it to yes to you are wrong you're wrong you're wrong I'm telling you why you are wrong you can see here this Java is different for Java and this Java is different for Java now you're understanding why all of these cases are important very good now you can see Java is case sensitive this Java for Java is different this Java for Java is a different Java all together so what it will do is he thinks he's a different Java that is why he will create the brand new object like this brand new object brand new address brand new address who will collect it yes2 will collect it yes2 will have this 2,000 and he will start refering to this object like this and let us see really S1 and S2 is having 1,000 and 2,000 or what let me get my program for you my program is ready and here I have to change this this I will eliminate this also I will eliminate I'll come here within double quotes I will tell it as Java like this good I'll come down here okay and here within double quotes I will tell it as Java come here put semicolon I don't want to compare the values what should I compare references of what S1 and S2 S1 yes2 the references should be compared what you should tell double equals means references now tell me what S1 is having th000 what S2 is having 2,000 same or different different different means If part will execute else part will execute else part will execute unequal you'll get you can see th000 2,000 both are not equal both are unequal really sir let me show you if in case I save it and execute it you can see unequal if you are using your signs and you used it already if only one string was there I should get output as equal right but are you getting une equal because two string objects understanding great with this let me go for the next case what's that watch it so this is my brand new program let me show you in the form of the segment this is my stack segment Heap segment everything is ready we have the code segment we have the template program we have a class we have a main method we have the first string good so we have yes one good we have the string good so we have this also new string awesome we have Java we have the reference there yes to what type it is straight this is line number one new without new without new where is the object string constant pool so string constant pool Java brand new address address will be taken care by yes one yes one we'll be having thousand and we'll be refering to that object that is what I'm showing is it ready let me proceed to the next one new without new new new means very good in the Heap area there is a brand new Java getting created with a brand new address like this and this address will be taken by one guy who is that yes to so yes two where you went please come back oh very good yes two to 2,000 and 2,000 means he'll be referring to this object got this great now let us see is this really the case of what I'll come here and I'll get my eclipse for you great so in my Eclipse I have to get something so what I will do is first one I will give it as it is but all of them are small okay same one I'll come here and here I will tell it as new new what sir string like this and here within double quotes I have to give something what is that sir within double quotes Java like this I'll put semicolon now tell me if I'm comparing the references there S1 and S2 look at s1,000 look at S2 2,000 same different same different different what output you'll get unequal you will get understanding great let us see is this the case of what I'll save this and execute it when I do that unequal is what the outut you are getting okay sir next what you might ask me I'll close this console and what I will do is I don't want to compare the references there instead I want to compare the values what you will do I will tell dot dot what sir equals this is what you should do tell me what output you will get equals une equal unequal because this Ava in lower case Ava in upper case both both are different that is why I'll get the output as unequal that is what I'm getting I want to make them equal what do you will do I will tell to my Java a Java please compare but please ignore the case like that now both of them are same only now if you execute it equal is what you're getting understanding great so with this I've covered all the test cases all the cases of your programs and with this only all the questions will come if this if you're really really perfect any kind of questions on the strings you can solve it not a problem understanding beautiful now let us go for the next concept now and if you ask me what is that watch it okay now what I will do let us conclude this okay how you will conclude there are different ways to create immutable scks there are different ways there what is that sir if you ask me number one you can create string like this new string open close semicolon put string what you want you have to give a reference there I'll give reference as yes what type it is string you can create one immutable string like this there's one more way to do it this is one more way no need to tell new without new you can create really sir let me show you I will tell their Java for him I'll will give the reference and I will tell what string you tell new without new there will be string object getting created this is not the only way in yesterday's class I've explained you the third way as well correct now let me show you there's a third way and what is that sir I will create one array wherein I'm inside an array I'm storing the characters to this array I'll give a reference the reference is C and C is refering to onedimensional array of character just like this what you have created an array but what do you need a string so you have to create string that is what I'm do new string I'll open this close this semicolon tell me my friends what do you want here Java Java you want where is Java j a VA a where it is C that is why C I will take it and put it here like this and for him you should give a reference the reference is yes what type it is straight these are the three ways of creating immutable strings in Java it should be there at the tip of your tongue and in interviews they can ask you any of them should be knowing all of them understanding great with this we have learned something else also what is that we have compared many things what we compared I want to compare the reference you have used this fellow double equals when you do that what you compared references you have compared in the same way you have used one guy who is that equals what you have compared values you have compared in the same way in the next coming class you're going to learn compare to wherein you are going to compare character by character like that what is this ignore at this point of time after this you have learned something known as equals ignore case wherein you're comparing the values but case sensitivity it is just removing it understanding great with this let us go for for the next one what is that watch it so what I will do is I'll bring one string there that is tap tap I'll bring one more string there Academy because where is tap there should be Academy tap Academy now tap and Academy should not separate tell me laa maju they should get separate Romeo Juliet they should get separate no laa came majun is always there like that tap is there Academy should also be there means what I want to do is tap Academy I want to bring them together I want to attach them together can I do it why not I will attach both of them tap Academy and this we call it as attaching this is a normal English but in Java is attaching we should tell it as concatenation concatenation means attaching to strength and how can I do it in Java concatenation you can do it in two ways this is the first way and that is the second way the first way is using plus the second way is using one guy his name is what G so let us start our journey by understanding how can I attach two strings with the help of plus how can I do it let me show you so let me show you with the help of an example for that stack segment Heap segment everything is there I'm having having my cot segment we have our template program as well we have a class demo public static void main he's also ready I'll create one string for you Java good I'll give a reference yes one what type it is string I'll create one more string what is that string python I'll take this bring it store it inside yes do what type it is string like this now what I want to do is Java and python I want to attach both of them how you will do I will take Java I will take Python and I'm attaching how using plus I'll get some result that result I'll store it inside one variable which variable S3 what type it is string like this but I'll not end my story here I'll go to the next line same Java I will take same python I will take I will attach whatever the result I will get i'll store it in inside S4 like this and I should tell what type it is what type it is it is string type and that is what I'm showing you so how it will be stored in the memory you know the story already main method execution started assignment new without new without new where string constant pool string constant pool you have Java we have the address as well who will collect it yes1 this is yes1 S1 will collect it S1 will be having thousand and he will start referring to him and you know the story how it is let me go here assignment new without new without new where string constant pool so there is a python getting created like this there's a brand new address also address will come and sit and where it will get collected sir inside yes2 yes2 will be having 2,000 he will start referring to python he's ready very good okay it came already yeah anyhow so you can see their assignment you can see there Java Plus python Java attaching python what result you'll get Java python look Java python he is also a string right if he is a string what are strings in Java objects where objects are getting stored in the Heap segment but in the Heap segment you have two things Heap area and string constant pool where it should get stored in the string constant pool why string constant pool because no new that is why it will get stored there okay good Java python no new there you can see no new that is why in the string constant pool there will be a brand new address for him and this address will be taken and stored by someone who is that S3 S3 will have 3,000 he will start referring to him good this is done let us go for the next one assignment right side Java Plus python what is the result Java python he's also a string string is what objects where objects are stored in Heap segment in Heap segment two things string constant pool Heap area where the Java python will get stored in the string constant pool why new no new very good Java python should get stored in the string constant pool but Java python is it there already Yes will it create one more Java python no why duplicates are not allowed so what it will do is it will take this address through it that side and who will catch it yes4 so yes4 will have this 3,000 to start refer got this let us see is this really happening or what I get my program for you great and whatever I have shown you let me do the same thing if else I need it I get it afterwards I'll come here and what I will do is I'll create one string string S1 equal to I'll give it as Java I'll put semicolon I'll hit enter I'll get the string there string yes2 equal to within double quotes I'll give it as python like this I'll come here I'll put semicolon I enter I'll tell string string what it S3 equal to within double quotes I'll give Java I'll come here attach plus within double quotes you should tell it as python I'll come here put call I hit enter I will tell string S4 equal to within double quates Java plus plus what within double quotes I will tell it as what python I'll put semicolon now I want to compare S3 and S4 I don't want to compare the values I want to compare the references can you please suggest me how can I do it good I told you when references you want to compare you should use him now let me use it I'll come here equals ignore case you should not use then what you should use S1 double equals S2 like this now tell me previously in my program what you had I mean in the diagram look at this what S3 is having 3,000 what S4 is having 3,000 are they same or different same means what part should execute If part should execute what you have equal that is what the output I will get really let me show you I will okay extremely sorry so S1 and S2 both are different but I want to compare what S3 and S4 this I want to compare I've changed it tell me what output I will get equal I'll save this and execute it you can see equal is what the I'm getting so this is the proof that this is how it is getting stored in the memory is anyone is having any doubts in this any doubt no doubt okay let us go for the next one what is that watch it I will close this Eclipse let me get my animation back and let me go to my animation change this and get my next program okay for that again I need stack segment Heap this these two people people will always be there don't worry about it we have the code segment also we have a class we have main method we have some instructions there same Java S1 string good we have python store it inside yes2 what type it is string previously what you did you took Java you took python you attached it what's this where is Java inside S1 means instead of Java Plus I can tell S1 plus what you have taken previously python this python where is present in yes2 instead of Java Plus python I will tell S1 plus what is python yes2 plus yes2 can I do it yes no problem you can do that really sir let me show you I will take this S1 plus S2 I'll give the reference S3 and I will give the type also there string I'll go to the next line I will take S1 plus S2 whatever the result is giving me I'll store it inside S4 and I will tell what type what type string now let us see how this will work you know the story where it is getting stored string constant pool why no new very good brand new address who is getting stored that yes one yes one is him yes1 will have that th000 he'll start referring to him python where is getting stored string constant pool why no new python is ready with a brand new address who will catch it yes2 that is my S2 S2 will have 2,000 he'll start referring to him good now the main line comes into picture assignment what is this S1 what is S2 python Java Plus python what is the result Java python they very smart and smartest of students are there yes one th000 yes2 2,000,000 + 2,000 3,000 yes3 is heav it's not like that then what it is yes1 Java yes2 python Java Plus python Java python Java python who is he he's a string string means Heap where Heap string constant pool Heap area where string Conant string constant pool very good string constant pool Java python will come and sit with a brand new address that address is 3,000 like that very good who will catch this 3,000 yes3 S3 is this 3,000 will come and sit he will start referring to him he'll go to the next one what is S1 Java what is S2 python Java Plus python Java python so now this is a string this is a string where it should get stored no new keyword no new keyword means what string constant pool means there will be S4 and inside S4 this 3,000 will go and sit and that is what I'm showing you now if I compare yes3 and yes4 what output I will get what output I get equal let us see will we really get this or what so I will close this I'll get my eclipse for you here is my Eclipse I just change this now how so instead of java where is Java present in yes one where is python present in yes2 yes2 you bring it the same thing here Java don't tell it yes one python don't tell it yes2 small chain and now what I'm comparing S3 and S4 you should visualize that tell me what output you will get equal let me tell you my friends your answer is equal but by your shock your answer is wrong it's unequal now the question is why that is what you guys are asking me why it is unequal what's this huh my friends this is what you are thinking this is your Java not James Gosling Java means what you're thinking is wrong no okay sir what is happening there my dear students you should not go with the logic new no new when you are going for concatenation you should not go for that logic new without new that logic you should apply when you're storing a string that's it but when you are concatenating new without new that log logic you should not use here and what logic I should use watch it when you're concatenating Java here not yes one Java not yes2 python what is Java value what is python value directly values you're concatenating then it will get stored in string constant pool previously what you given here Java what you given here python both of them are string values string string values attaching where is getting stored string constant pool now you tell me is this value this is yes one what is yes one reference and this reference is having this value means you are concatenating not with the help of java directly instead with the help of what reference whenever you use the reference like this the brand new object is not not getting created in the string constant pool no it will not get created instead where it will get created sir inside he per will get created like this and why it is getting created like that if you ask me because you are concatenating Java and python only but with the help of what references when references comes into picture he per where it is getting created got this great now tell me here this is a brand new object object brand new address brand new address who will collect it yes3 very good yes3 we'll have 3,000 he start referring to him like that good next what sir you can see here assignment right side how you're concatenating Java python only how you concatenating references reference come into picture tell me where it should get stored inside the Heap area now tell me inside Heap area one more Java python you required is already Java python is there yes can you create one more Java python yes why duplicates are allowed that is why it is creating one more Java python it will be having the brand new address that will be collected by your great S4 S4 will be having that 4,000 and it will start refering to that object and that is what I'm showing you you can see now what you are comparing S3 and S4 what is S3 what is S4 equal une equal unequal is the output you got not the equal so the same logic you should not go on applying for all the concepts of Java for each Concept in Java is having a different different logic there and you should understand what is that logic you guys understand great so now you can see my friends with values you're concatenating where string constant pool with the references you're con cating where in the Heap ERA this should be there stamped at the back of your head any doubt in this no doubt if you guys really understood this then tell me what is output for this what that said okay now what I will do I'll get my eclipse for you this is how my Eclipse looks like what I will do friendes yes one is what Java so what I will do instr of S1 directly I will give Java what is S2 Python and I want to give python in the form of S2 only good in the same way what is S1 what is S1 Java Java I want to give it how within double quotes I will tell Java like this python I want to give how with the help of reference that is yes to now tell me if I compare S3 and S4 what output you will get you should visualize now first line what will happen second line what will happen third line what will happen fourth line what will happen you should visualize maybe my friend will tell the answer yeah you tell me what's the answer you behind you you what's the answer for that [Music] yeah equal unequal why unequal yeah why unequal please sit thank you so much for all the respect you can tell me why unequal first line where that object is getting stored see you just please come and stand here and just look like this each one of you what you are doing is clearly visible who is sleeping who is concentrating who is using the mobile I can now pinpoint at each of the students there who are using the mobile you want me to do that now you should understand I've trained F 50,000 students 50,000 okay what a student can do I know previously in 2019 one student using the mobile how using like this when I was teaching you know like this like this oh sir understand when I turn around like this so her mobile was here and the reflection of the mobile was visible in her specs and I caught her and sent her out so I'm just telling you my friends you want to literally use the mobile want to use the mobile this is not the place outside the class you can use it because what happens is you're using the mobile good you're use it you're spoiling your life with this your friend's life also you're spoiling because you're using the mobile you're chatting your friend to whom she is chatting is a behind Guy oh what she's using what he's using means you know negativity bucket you take water is there Stone you take put it there you know the Ripple where it will reach till the circumference of the bucket that is how it is you're getting spoiled I don't care but don't spoil the other students who are here as a committed students and I not will make it happen I'll not make it happen is that clear and again I don't understand that why you have to come from your pgs from your home travel here just to use the mobile you can do it in your home itself right and you can watch the video there no problem okay because see I don't care it's your life my friend as a teacher what is my responsibility is to give the best content best teaching and best what I'm having by the end of the day if the students are taking this with four I mean with both the hands good you get placed as soon as possible but for other students you know I feel very pity not for you but for your parents because when your bath started you know your parents came with the bags you're not holding it your parents are holding it they came here you came to the class do you know where they are sitting do you have any idea where they were sitting they're sitting in the steps waiting for you now you are here using the mobile at this point of time you should be telling to your parents I'll take care of you you're not doing it above this this is what you do it's not for everyone for the students who use the mobile okay what's the output here you're using the mobile be honest using the mobile that is why I ask the question to you okay straight you also the girl you also using the mobile am I correct no really huh okay what's the output equal unequal equal unequal unequal why unequal Java where is getting stored in see we should visualize string constant pool this guy string constant pool very good what about him Java Plus S2 what is S2 python Java python only but how you're attaching using reference when when you see the reference you should understand it is Heap area that's it now tell me where is present in Heap area where is present in Heap area Heap area means two objects two different addresses understanding so what output you'll get now unequal and that is what the output I will get if in case you execute it in this way very good I'll close this console what I will do now is Java I'll give it as yes one yes2 I'll not what is this do python can I give it like this yes no problem you can give it one reference one value both references both values like this you can play good now I'll come here remove this and I'll give it as yes one S2 I will give how I will give within double quotes how is that python like this now I want to compare S3 and S4 tell me what is the output I will get very good I will get output as unequal you can see that is what the output I'm getting why is that reference you have used reference means what Heap area anyone is having any doubt in this no doubt great so now let us conclude what is that so get my animation to conclude this we already started our concatenation and there are two ways of concatenating number one is plus number two is concat let me come here and what I will do is two string values and I'm concatenating like this I can concat concatenate using references one value one reference also you can do one reference one value also you can do like this now if you're storing are you concatenating these two string values like this where is getting stored string constant pool what about him heia means reference means heia what about him heia means reference what about him he peria why it's reference so let me properly differentiate by drawing some boxes this is string constant pool all of them are he area how you should remember this you should understand reference you see he area only two string values means string constant understanding great first one done and dusted let me proceed further who is he conat now the question is who is this conat who is he that is why I have to show you something what is that what I will do is I'll get one object for you like this great Which object is this let me show you what I will do is I will tell here new new what string good inside this I will tell it as Java like this and for him I'll will give the reference the reference is yes and what type it is Sir string like this now tell me where this object is getting created inside the Heap segment see this is Heap segment and inside this you have two places what are the two places string constant pool and this is what Heap area where that object is getting created in the Heap area and this only I am showing it in the form of this understanding great now question is how it will be presented see most of you really think that the object what it will be creating is like this Java 0 1 2 3 address and there is one reference yes you'll refer to this this is what you are thinking correct but actually my friends this is not how it is exactly then how it is Sir whenever you tell new string like that only Java will not be there an entire object will be there like this long way back in your fourth class of your object orientation you have learned the third rule what is the third rule object orientation you have learned some rules right principles what is the first principle world is a collection of objects number two every object belongs to a type type is known as a class class is imaginary object is real what is the third one every object is having two parts one is known as what State and properties the next one is known as Behavior State and property is also known as state and behavior is also known as what Behavior but you should not tell like that so State and properties is known as has behavior is known as what does we have has and we have does also and that is what I'm showing you what's this in the has part what you have in the has part you have the Java and that is what I'm showing you the D part what do you have tell me how you'll quote D part using what methods so this is not new you have learned this already how will code do part methods means inside do we have the methods what are the methods sir that is what I'm showing you that's a wrong editing okay anyhow so we have the methods there there is first method who is he equals equals is a method there's one more guy who is that Kat he's also a method like that there's one more guy who is that equals ignore case all of them are the methods which is present inside the string object understanding now tell me what is conat it's a method understanding great so now watch this so what I will do I'll get my Eclipse to code one program for you what is that watch it so what I will do is I'll remove this what I will do within double quotes I will tell it as Java previously you have used what plus plus I'll not use instead what I will tell concat what do you want to concat python so python I will delete in the same way I want to do it and repeat so I will take this line I will copy and I will paste it with semicolon now if you see previously plus you have used instead of plus what I'm using conat like this Java concat python now I'm comparing S3 and S4 what do you think think what output you will get yeah quickly I will get my segment you should think about it and tell me the output the focus should not be there on my diagram focus should be on thinking of that what is the output what you think tell me what I think and Java think I will tell you what do you think you tell me first equal unequal okay equal oh great see first line where the object is getting created first line Conant string constant pull where string constant pool or Heap area where string constant pool very good this is Java there is one reference what is the reference yes one refering to him line number two python where it is present in string constant pool so python is present like this yes2 is referring to him the most important line tell me where is getting stored so Java is a value python is a value you're concatenating what you're thinking what you thinking Java python this is getting stored inside where string constant pool because you're applying the same logic what you applied previously correct yes or no what logic I told you when there is a values using plus string constant pool correct tell me Java python string values using plus sir no using what conat when you hear this word conat you attach using string values 100% it is not not in string constant pool it is Heap area why you have used conat there you have used plus there string constant pull no problem but what you're using conat means it is in Heap area understanding good so now there is Java and python getting stored here that is what I'm showing you Java python is ready and who will be referring yes three there is one more guy Java and python what you're using there concat concat means where he per already Java python is there what will happen one more Java python will get created why duplicates are allowed very good Java python there will be one reference what is the reference S4 S3 S4 same or different they are different and that is why you'll get the output as unequal if in case you execute it unequal is what you are getting understanding great watch this now what I will do instead of java where is Java present in yes one yes one I will give instead of python where is python is present in yes2 yes2 I will give it in the same way Java is present oh okay I'll give it sorry so I'll give it as yes to great so here also I'll remove it and I will give yes to tell me what do you think what is the output don't anything what is the method you have used concat concat means what he area only means you can concatenate using the references like this but what I used concat concat means what he means this is how same it is getting stored now let us see what output I will get I'll save this and I will execute when I do that unequal getting very good now what I will do how I did previously one I will use value one more reference one value one more reference you can do that here what do you think what output you'll get conat you saw that's it it is Heap area means you're going to get the same output only very good first Java I want to give yes one yes2 means what python within double quotes I'll give it as python so what I will do the same thing I will copy and bring it here that is pasted now tell me what is the output unequal again why unequal because concat you have used Heap area this is how the diagram looks like it's from this this is quite simple concat means what eyes closed be area understand it great now let us see and conclude that when you're using concat method how this will work okay what this so we have the concatenation you have concatenated Java python directly good you have concatenated using S1 and S2 you have concatenated with value as well as reference you concatenate it with both of them as I mean one reference and one value where this is getting stored H peria good where this is getting stored heia where this is getting stored Heap area where this is getting stored Heap area me I can put it in the Box all of them are Heap area only means in this concatenation story only one guy is string constant pool who is he string values with plus string constant pull other than that Heap area this is how you should remember got this great with this this is the end of your concatenation so in tomorrow's class we will understand about one more important concept that is compared to what is compared to comparing character by character you want to know that yes come attend my class on Monday you'll get to know but at this point of time I'm putting full stop to my session so your smiles are very important keep smiling see you on Monday for e