Interview Question : Compare Two Integer Numbers (Integer Caching) in

  Рет қаралды 43,903

Naveen AutomationLabs

Naveen AutomationLabs

Күн бұрын

Пікірлер: 86
@amitkumarshinde4090
@amitkumarshinde4090 3 жыл бұрын
Hey man u r really awesome, i have never been explained this concept Or never heard this concept. Really thankfull to you man.. Keep rocking
@ankittripathi6150
@ankittripathi6150 3 жыл бұрын
Sir I did have 3 years of experience in Vmware but after learning through your channel only i have switched to testing by showing the same 3 years experience in that. Your way of teaching is excellent.
@saikrishnagaddam8857
@saikrishnagaddam8857 3 жыл бұрын
Bro are you serious?
@priteshms
@priteshms 3 жыл бұрын
I never heard about this concept. Learnt something new. Thank you so much Naveen for all your efforts.
@SameerKumar-yu1xi
@SameerKumar-yu1xi 3 жыл бұрын
I will not comment thx for the contents that Naveen sir posting... Bcz he is doing it and helping in thankless manner... Just appreciating his hardwork and for motivating us🙌🙌🙌
@durgaprasad4648
@durgaprasad4648 3 жыл бұрын
Thanks bro for making us Technicaly strong.
@nikhildandge8609
@nikhildandge8609 3 жыл бұрын
Also , this caching concept is not available for Float and Double . ( because between 0 and 1, there infinite values that lie within the range and can't decide which is the most common range used) I liked the video very much @naveen . Thank you very much
@madhuriparjane3054
@madhuriparjane3054 3 жыл бұрын
Hello Naveen, you are simply outstanding in explaining the important and complex concepts..Really like the way you put the things in short, crisp but understandable manner. Thanks for this awesome work.😊
@suryajit7
@suryajit7 3 жыл бұрын
thanks man - I will ask this question in my interviews now
@amitkumarshinde4090
@amitkumarshinde4090 3 жыл бұрын
I will definitely share ur videos everywhere
@raji1358
@raji1358 3 жыл бұрын
You are awesome because I learnt a lot from you.
@riteshranjanmishra967
@riteshranjanmishra967 3 жыл бұрын
Thank you Naveen for covering important interview questions
@syedafarzana960
@syedafarzana960 3 жыл бұрын
You are the best sir plz explain all the recent java coding questions asked in interview
@sksingh329
@sksingh329 3 жыл бұрын
So integer caching works in range of Byte data type.. It was intresting. Thanks for sharing
@AshokKumar-ye3zc
@AshokKumar-ye3zc 3 жыл бұрын
Very informative video. Where can we use this concept in the framework?
@sridharlanka2721
@sridharlanka2721 3 жыл бұрын
Informative & truly interesting 🧐
@pvgr0007
@pvgr0007 3 жыл бұрын
Simply awesome 😎😎😎
@saikiran-zi1sm
@saikiran-zi1sm 3 жыл бұрын
Thanks for uploading this video helping me a lot sir how to string and float comparison this question was asked at the time of interview.
@minku2008
@minku2008 3 жыл бұрын
Thank you Naveen ,expecting more 👏👏👍
@rajatgarg582
@rajatgarg582 3 жыл бұрын
Thanks @naveen for all the stuf..
@sivapavan490
@sivapavan490 3 жыл бұрын
U r explanation is good sir. Why u did not upload complete java course
@shilparathod1573
@shilparathod1573 3 жыл бұрын
Lai Bhari.Again Thank you for sharing
@gag97
@gag97 3 жыл бұрын
Nyc sir and we need ur support in further videos too
@shankumondal2881
@shankumondal2881 3 жыл бұрын
Awesome 👍
@vibhagupta2618
@vibhagupta2618 3 жыл бұрын
informative video
@sriyanshjain6645
@sriyanshjain6645 3 жыл бұрын
Thank you so much for this concept❤️
@shashibhushanv6301
@shashibhushanv6301 3 жыл бұрын
Good one
@ragavaanvesh
@ragavaanvesh 3 жыл бұрын
Thank you so much for this info😍
@PradeepKumar-fq7fz
@PradeepKumar-fq7fz 3 жыл бұрын
Thanks Naveen, how to work with strings without using built-in methods please make a video on these topics I hope you understand thanking you in advance
@tejatummala
@tejatummala 3 жыл бұрын
Hi Naveen, Any tips for Kafka automation? Can you suggest me some tools to Test Kafka.
@nikhilgayki8807
@nikhilgayki8807 3 жыл бұрын
Thanks naveen...
@himanshupokhriyal6883
@himanshupokhriyal6883 Жыл бұрын
Output -) both are equal because data is same in both variable num1, num2
@pradeeppattar8862
@pradeeppattar8862 3 жыл бұрын
Yesterday I got this type of question.
@eduartzina
@eduartzina 3 жыл бұрын
Hello, very good knowledge here. in my case, I had a situation of : taken two arrays. array 1 = 5 and array2 = 2. the question was How to compare every index in the array and how to find how much should I add to array1 to be equal to array2? it was a tricky one and to me, this was the first time having to work with two arrays and compare values. How will you approach this situation?
@nilstoned7593
@nilstoned7593 3 жыл бұрын
int[] arr1 = {1,2,3,4,5}, arr2 = {6,7}; int sizeDifference = 0; if (arr1.length > arr2.length) { sizeDifference = arr1.length - arr2.length; System.out.println("Items to be added in Array2 : " + sizeDifference); } else { sizeDifference = arr2.length - arr1.length; System.out.println("Items to be added in Array1 : " + sizeDifference); }
@eduartzina
@eduartzina 3 жыл бұрын
@@nilstoned7593 thank you.
@TusharKavle
@TusharKavle 3 жыл бұрын
Thanks Naveen..Cheers
@sameerkadgaye2048
@sameerkadgaye2048 3 жыл бұрын
Thank You Sir
@phanikumarvishnubhotla1804
@phanikumarvishnubhotla1804 3 жыл бұрын
Thanks @naveen
@krantikamble4784
@krantikamble4784 3 жыл бұрын
Hi Naveen Sir, Could you please update on How to Create Selenium WebDriver Screenshots and Integrate With Jenkins
@vengateshm2122
@vengateshm2122 3 жыл бұрын
Where can we apply this concept in practical?
@ashwinikhanna
@ashwinikhanna 3 жыл бұрын
Only in interviews!
@vengateshm2122
@vengateshm2122 3 жыл бұрын
@@ashwinikhanna Ha ha ha
@sainathvallampatla5135
@sainathvallampatla5135 3 жыл бұрын
Thanks Naveen
@SameerKumar-yu1xi
@SameerKumar-yu1xi Жыл бұрын
Hello Naveen, Greetings!!! I was trying this scenario in my system and it works as mentioned in the video.. But i tried comparing Integer a = 123 and int b = 123. In this case it matches and showing true as results... Also tried out of the bond number for integer caching ie 130 or any number outside the range.... It was matching.... Could you pls explain
@VipinDahiya89
@VipinDahiya89 Жыл бұрын
concept is for comparing two object and in second you are using int var not object
@anjalimurkute1378
@anjalimurkute1378 3 жыл бұрын
Thanks a lot ..🙏
@vishal252526
@vishal252526 3 жыл бұрын
Hi Naveen, could you please explain below scenrio. Integer i=300; sout(i==i) ; output-> true why it is not false???
@balachandar6206
@balachandar6206 3 жыл бұрын
Both I are pointing same variable
@Erlisch1337
@Erlisch1337 3 жыл бұрын
oh its a Java thing...that explains why Ive never heard of this
@naveenautomationlabs
@naveenautomationlabs 3 жыл бұрын
Yeah that's the hidden concept of java :)
@rajatprajapati7140
@rajatprajapati7140 3 жыл бұрын
But range for int is larger than - 128 to 127.Then why does it give true only for - 128 to 127 ?
@sreevidyarejeesh8695
@sreevidyarejeesh8695 3 жыл бұрын
👍👍
@murahariraofam6473
@murahariraofam6473 2 жыл бұрын
What is the purpose of integer caching?
@rayinimadhu
@rayinimadhu 3 жыл бұрын
Sir my name is Madhu I'm Complet my Degree BCOM camarce how to came IT SOFTWARE side frst which course lm luarn...... please give me a gidence..
@Viplove_QA_SDET
@Viplove_QA_SDET 3 жыл бұрын
👍👍👍❤️
@muralikrishnap4337
@muralikrishnap4337 3 жыл бұрын
What is auto box
@kathiresanm4280
@kathiresanm4280 3 жыл бұрын
-128 to 127 is a range of byte data type then why the Integer is compared byte range
@sayhifive2415
@sayhifive2415 3 жыл бұрын
But @Naveenautomationlab You still comparing references not values. So no point of values are being in range or out of range.
@naveenautomationlabs
@naveenautomationlabs 3 жыл бұрын
No it matters. Check the full video when you go out of range of integer Cache it will give you false. So range matters here.
@sauravMAitra96
@sauravMAitra96 3 жыл бұрын
@@naveenautomationlabs if i use long then it will be right .. isn't it?
@sonatejas7224
@sonatejas7224 3 жыл бұрын
all wrapper classes override toString() to return value of the object the reference variable is pointing to
@rivermartinez107
@rivermartinez107 3 жыл бұрын
What happens if you use .equals()?
@weirdspecie6356
@weirdspecie6356 3 жыл бұрын
You have to rewrite it with string cuz .equals doesnt work on int
@chintulovers
@chintulovers 3 жыл бұрын
Is this applicable for double
@ManishKumar-qx1kh
@ManishKumar-qx1kh 3 жыл бұрын
All wrapper classes come with caching but remember u can use caching only when u r using either primitive assignment or using valueof() method. If u are using new keyword while creating the object then it won't work.
@blazegaming3810
@blazegaming3810 3 жыл бұрын
Idk what ur java application is doing my java application even show results as equal on 300000 comparing on both integers. I have cross-check by giving other integer values but it always shows same unless both integers r different. Idk what ur machine is doing.
@naveenautomationlabs
@naveenautomationlabs 3 жыл бұрын
Are you sure ? Which jdk version you are using? Can you paste your code here?
@blazegaming3810
@blazegaming3810 3 жыл бұрын
@@naveenautomationlabs okay so old version will show different result??? My java version shows 11.0.1
@naveenautomationlabs
@naveenautomationlabs 3 жыл бұрын
Integer Caching got added after 1.5 only. Make sure you are using Integer not int.
@blazegaming3810
@blazegaming3810 3 жыл бұрын
@@naveenautomationlabs Thanks a lot. U r correct I was using int In place of Integer ✌🏻✌🏻✌🏻
@naveenautomationlabs
@naveenautomationlabs 3 жыл бұрын
Good :)
@loknathshankar5423
@loknathshankar5423 3 жыл бұрын
Why is there such a thing?
@satishkumarsingh5934
@satishkumarsingh5934 3 жыл бұрын
Both are equal
@snehaparekh8502
@snehaparekh8502 3 жыл бұрын
Equalas values are same
@arushigupta2400
@arushigupta2400 3 жыл бұрын
equal
@chintulovers
@chintulovers 3 жыл бұрын
Djava.lang.Integer.IntegerCache.high=2000
@ShinAkuma
@ShinAkuma 3 жыл бұрын
My question is not "what actually is integer caching". My question is, where do you even find this information ? In my 7 years of studying Java and I've never even heard of this before. O_O
@naveenautomationlabs
@naveenautomationlabs 3 жыл бұрын
This question was asked to me once at the time of interview few years back.
@puneethchidura3713
@puneethchidura3713 2 жыл бұрын
both are not equal
@kumaranthiru203
@kumaranthiru203 3 жыл бұрын
Thanks Naveen
@ravindrabaranjalekar1068
@ravindrabaranjalekar1068 3 жыл бұрын
Both are equal
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Why String is popular HashMap key in Java?
16:53
Naveen AutomationLabs
Рет қаралды 15 М.
Tricky Interview Question: Maximum Number of Method Parameters Allowed in #Java
13:31
Java random numbers 🎲 【4 minutes】
4:27
Bro Code
Рет қаралды 178 М.
Find Duplicate Elements in An Array || Important Java Interview Questions
22:36
Naveen AutomationLabs
Рет қаралды 53 М.
Learn Any Programming Language In 3 Hours!
22:37
Code With Huw
Рет қаралды 644 М.
Star Pattern Logic - Part 1 - By Naveen AutomationLabs
22:34
Naveen AutomationLabs
Рет қаралды 65 М.
Caching - Simply Explained
4:55
Simply Explained
Рет қаралды 129 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН