Java switch/swap two variables #Java #switch #swap #variables
Пікірлер: 572
@BroCodez4 жыл бұрын
Drinking game: Take a drink everytime I say the word 'VaRiAbLe' //************************************************ public class Main { public static void main(String[] args) { String x = "water"; String y = "Kool-Aid"; String temp; temp = x; x=y; y=temp; System.out.println("x: "+x); System.out.println("y: "+y); } } //************************************************
@F2_CPB2 жыл бұрын
I know I'm late to party But me after drinking game: String Result = 1:32
@treebit4 жыл бұрын
That's what I call visualisation!
@editIQYT Жыл бұрын
Fixing commentsc
@nathanlutz41446 ай бұрын
And it’s thirsty 😂
@haroldw28233 жыл бұрын
Dude that visual representation of switching content was the best I've seen. It actually has me thinking about programming in a different way now. Well done mate!!!!
@АлексейСоловьёв-ь3щ5ш3 жыл бұрын
This is the most obvious explanation for beginners I've ever seen. Thank you, bro!
@bluebodycamera3 жыл бұрын
Visual teaching is always great, its even better when the visuals are funny!
@laylachisom8996 Жыл бұрын
It’s not very often I find a teacher I understand on KZbin for Java , but I now have Thanks for making it easy to understand!!
@huuloc87192 жыл бұрын
Today, I start learning OOP in Java. Thank you so much for this free course. I will comment on every video I have learned.
@BroCodez2 жыл бұрын
yay!
@nailpluckers3 жыл бұрын
int a = 10, b = 20; int temp = 0 ; temp = a ; a = b ; b = temp; System.out.println(" The value of a is : " + a ) ; System.out.println(" The value of b is: " + b) ; Yay! Swapped the variable! :)
@sushantlama90103 жыл бұрын
Best explanation in the KZbin history......
@GeoffreyofCastille3 жыл бұрын
Found your channel looking for help in JavaFX - taking an online college course in Java and my instructor's idea of teaching is assigning a chapter to read, assigning a single program, assigning a quiz....and that's it. Watched your first JavaFX video and decided to start at the top because your videos are 1000% more useful than my class. Subscribed!
@bluehue12 Жыл бұрын
I feel you on that. I am currently enrolled in Coding Dojo part time online, and it is the same teaching strategy. I am learning more from Coursera and youtube videos 😂
@mercycebu28963 жыл бұрын
I'm a begginer in java programming and your tutorials helps me a lot♥️
@snekeater980 Жыл бұрын
public class SwitchingVariables { public static void main(String[] args) { String Mug = "Coffee"; String Glass = "Milk"; String ExtraCup; ExtraCup = Mug; Mug = Glass; Glass = ExtraCup; System.out.println("Mug with "+Mug); System.out.print("Glass with "+Glass); } } It was very easy to understand when you did the Water and Kool-aid showcase
@snzero5438 Жыл бұрын
i like your Variables names
@rekan_983 жыл бұрын
I have been started studying at the university for 3 years ,but this helped me a lot to understand the swapping logic thanks
@rohan00702 ай бұрын
Now I really Understood how Variables are Swapped, Thanks for the Real Life Explanation.
@drone-Eye2 жыл бұрын
Bro, I had Java-phobia, but thanks to you that's faded. Simply, great work brooooo!!!
@selerdem13913 жыл бұрын
honestly bro ur videos are so helpful learning java because its not being presented as a robot professor who just reads out of the book in all of my courses. def gonna recommend u to all my classmates.
@PhilosoCoder2 жыл бұрын
Awesome, cool in style and teaching method.
@sadatishraq60206 ай бұрын
you're one of those GOATED teacher! Love you!!
@AIMENABDU Жыл бұрын
you saving lives out here .. thank you "Michael Scott impression"
@chunmaroo4 жыл бұрын
I'm still have a bunch of school homework now. after all of these, I will watch your newest java tutorials 😊
@mansalek2 жыл бұрын
that visual representation was genius bro
@selmanozturk6816 Жыл бұрын
Such a great visual expression.
@Google_Engineer3 жыл бұрын
Wow!! Godfather of youtube Teachers ,♥️🙏
@annderby62953 жыл бұрын
Awesome teaching technique - use of a real life illustration that people can relate to. Nice! Empty the contents of cup X into cup TEMP, now cup X is empty. Empty the contents of cup Y into cup X, now cup Y is empty. Empty the contents of cup TEMP into cup Y, now cup TEMP is empty & cups X & Y are full.
@Sanyam10104 ай бұрын
thank you so much I am watching one lesson every day 🤓, trying to learn java from your videos ,keep it up 👍
@JuliHoffman2 жыл бұрын
Sorry about your floor, Bro. This visualization actually made sense! Thank you!!!
@rohitgiri92663 жыл бұрын
I like the way of you Teach!❤❤😍😍 - Love Programming
@m.s.mehedihasan3 жыл бұрын
you are so good as a teacher. I am loving your tutorial.
@Ushiwakamaru_BAU_BAU2 жыл бұрын
My brain just melted from this very simple demonstration... A new window has opened for me.
@aryanmn15693 жыл бұрын
u r such a bro, and I simply don't get tired to spam your comments with appreciation
@bloggingbyasifali498410 ай бұрын
Ur teaching was clear and crystal ❤❤
@sankartechpro4 жыл бұрын
Really awesome with real world examples. You're super.
@scholar00987 ай бұрын
best coding teacher cant express how good he teaches
@玉姬-z4z2 ай бұрын
very interesting explanation
@seguchi33333 жыл бұрын
Thank Bro Code. I could learn java code in English. Step by step , I will watch your video in japan.
@amandoktorcanimkuzumdoktor51933 жыл бұрын
Did you finish watching all of them 100 videos, bro?
@local_gymbro9 ай бұрын
Here's my example how I practiced it today: public class VariableSwitch { public static void main(String[] args) { String x = "Catfood"; String y = "Dogfood"; String temp = null; x = temp; x = y; y = temp; System.out.println("x:" + x); System.out.println("y:" + y); } } Just basic sh but you still helped me out a lot. Thank you
@alwaysmotivativated77744 ай бұрын
I had not ever watched that type of wonderful visulation ❤ Amazing 🤝
@husein_alfil3 жыл бұрын
Amazing genius explaining !! Keep that great method ! I subscribed 2 times 😄
@CPawnchАй бұрын
Thanks for another video Bro! I'm still quite new to this so I don't understand the purpose of switching variables. Hoping to learn more and answers as I watch your videos!
@maxjustmax5213 жыл бұрын
Bro you are awesome and a lot of fun to study with!
@ryannayak57973 жыл бұрын
really loved your way of teaching!
@lucathebrainrot2 жыл бұрын
Breathtaking visuals.
@TheAnuNay6 ай бұрын
I am watching it in March 2024 and found the coolest way to understand.
@honeybutter70742 жыл бұрын
Omg I love this visualization. Can't even mix that logic with this explanation. TYSM.
@EsmatullahSayed Жыл бұрын
I really liked the way that you swap the variable value with showing live example.
@alimustafaali28023 жыл бұрын
really loved your way of teaching
@99Hitsugaya3 жыл бұрын
Well that live demo was fun :)
@niladri.g233411 күн бұрын
Perfect channel to learn programming
@kirillutsenko93062 жыл бұрын
Visual method is the best way to explain something
@creativeryu9682 Жыл бұрын
Uhff Broooo, this is the best variable swapping tutorial I've every seen. I need to come up with this juicy visualization in my class. Never had so much fun by learning a new programming language.👍😎👌
@Atiqul_Akash11 ай бұрын
That Real Life Example was really helpful. Thanks
@rakhmatillomaribjonov51143 жыл бұрын
This is the great explanation I have ever seen👍👍👍 Good luck
@fabnsavvy Жыл бұрын
I so needed this video for my quiz last night. I totally understand it so much better now, thank you!
@aryanmauryamr.perfect1426 Жыл бұрын
World's best teacher 🙃☺️☺️☺️☺️☺️ real life examples 😅🤘🤘
@marxmarx50583 жыл бұрын
haven't seen a better teacher in my life
@ilcwm1623 жыл бұрын
Your tutorials are soo fun to watch and easy to understand i dont understand why you are so underratedd!!
@mbilal110974 жыл бұрын
Really liked the kool-aid and water example. Love your vids keep up the good work bro.
@BroCodez4 жыл бұрын
thank you for watching Mohammad
@pallabganguly65252 жыл бұрын
The visual representation is too good man. 😀; Big Thumps up
@python3604 жыл бұрын
$ python a, b = b, a You've been a great audience, goodnight!
@aryanmn15693 жыл бұрын
that's why I love it and hate it at same time
@avinduvidusanka8 ай бұрын
Real life example is awesome 🔥
@ihssanenedjaoui14447 ай бұрын
best explantion of the concept ever
@AP.3.2 жыл бұрын
public static void main(String[] args) { String x = "Lemon"; String y = "Water"; String temp = null; // extra string for switching manually temp =x; //pour x into null glass x = y; //pour y into x This helps us switch x and y y = temp; // pour temp into y System.out.println("a: "+y); //use println for printing 2 seperate sentences System.out.println("b: "+x);
@Vivekpandey-cy1ul3 жыл бұрын
I have not seen any better example like this before.
@Grindelfein3 жыл бұрын
At first, I really needed to think about it, but I got it when I realized that the programm is executed line by line and that the variables therefore can be redefined depending on the (time)line the programm has progressed to (if that makes any sense). I think one can gets confused because in math, a variable is always fix (at least what I know from school math). I don´t have programming experience myself, I am just trying to find a language to start with by looking through some tutorials. Nice explaination!
@tazzythylacine71232 жыл бұрын
Your content is pure gold :D
@aichalahnouki759410 ай бұрын
4 years into computer science and this is the first time that I have ever understood how swapping works for real :)
@somebody.2 жыл бұрын
I am seriously glad I found ur channel!!!
@ManVsBugs Жыл бұрын
I appreciate the visual demonstration of the code!! good effort thank you
@claire_92192 жыл бұрын
The explanation is so clear, thank you for your attentively.
@Shredfam5 ай бұрын
I think I understood the assignment. public class Main { public static void main(String[] args) { String x = "Burly"; String y = "Girly"; String temp; temp = y; y=x; x=temp; System.out.println("x: "+x); System.out.println("y: "+y); } } Learning Java next semester. Thanks for the vid.
@manashdebnath7168 Жыл бұрын
The best explanation in the globe.
@amarboparai4159 Жыл бұрын
That live example was an overkill 😂
@annoyingprecision2487 Жыл бұрын
Entertaining and mindblowing. Thank you.
@pavelkvasnicka6856 Жыл бұрын
This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro
@flavialuyima11 ай бұрын
i have to say i found this real life example very funny and also helpful
@SoyadRahman-g3v7 ай бұрын
Love from bangledesh bro you are doing good i saw your c++ vedio thats helped me a alot in the in my term;
@nhatnguyenquoc2004 Жыл бұрын
Thanks for your real life example with water :) It makes me understand more on this swapping method
@sk.faizanhussain2812 ай бұрын
I never saw a video LIKE this❤❤❤
@darrenfrancis8126 Жыл бұрын
something that helps me is writing comments describing whats happening when i set a variable equal to something. For example: temp = x; //temp is set to the value of x(water) x = y; //x is set to the value of y(kool-aid) y = temp; // y is set the value of temp(water) NOTE: remember temp was set to x which is the value of water
@Nabiile9 ай бұрын
bump
@alan-overthenetАй бұрын
Best explanation I have seen
@buddhimakaushalya29122 жыл бұрын
that real life example is awsome brooo
@JustNeutral14.3 ай бұрын
int x = 3; int y = 4; int temp = 0; temp = x; x = y; y = temp; temp = 0; System.out.println(x + ", " + y); Thanks for the tutorial!
@boringmangesh Жыл бұрын
One of the best course till date for JAVA!
@ericmovsessian41023 жыл бұрын
Awesome bro, this is helping A LOT. Whish you all the best.
@Andboldquates Жыл бұрын
amazing, simple explanation, thanks bro
@Zoid-Berg Жыл бұрын
Best visually real life example
@sharonselah76072 жыл бұрын
Love that presentation
@PaulLein-t9m Жыл бұрын
Great visualization! I will be using that in my class.
@mohammedhero69333 жыл бұрын
This was a great explanation for how to swap between these variables 👍👍👍👍👍👍👍
@Dev-PauloEd2 жыл бұрын
Muito obrigado, mano, pelo vídeo. Certamente aprendi algo novo com isso
@AzizbekIunusov4 ай бұрын
public class Main{ public static void main(String[] args) { int x=14, y=415; int s; s=x; x=y; y=s; System.out.println(x); System.out.println(y); } } You are a great Teacher!!!!!
@shbenti2537 Жыл бұрын
Love the visualization
@adarshsharadpandey67233 жыл бұрын
Became your fan brooooo 😍😍😍 Love from India ❤️❤️❤️❤️❤️
@maxbrown99773 жыл бұрын
You are great can't express in words ❤
@Momo-iq6uu Жыл бұрын
Best video I've ever seen. You're a genious.
@MorbidPasta2 жыл бұрын
idek why i'm watching a java video but the cups of water was hilarious
@redgey51633 жыл бұрын
Thanks for the brilliant video. 2 people clearly drank the Koolaid....
@supersakib622 жыл бұрын
What a visualisation!!
@stefan54503 жыл бұрын
I tried to change between a glass of beer and a glass of whisky. Long story short: I messed up and drank both.