What's new in Java Switch | Switch Statement and Expression

  Рет қаралды 120,036

Telusko

Telusko

2 жыл бұрын

Check out our courses:
Spring and Microservices Weekend Live Batch : bit.ly/spring-live-weekend
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : bit.ly/java-spring-cloud
Instagram : / navinreddyofficial
Linkedin : / navinreddy20
More Learning :
Java - bit.ly/3xleOA2
Python :- bit.ly/3H0DYHx
Django :- bit.ly/3awMaD8
Spring Boot :- bit.ly/3aucCgB
Spring Framework :- bit.ly/3GRfxwe
Servlet & JSP :- bit.ly/3mh5CGz
Hibernate Tutorial :- bit.ly/3NWAKah
Rest API | Web Service Tutorial :- bit.ly/38RJCiy
Git :- bit.ly/3NUHB3V
JavaScript :- bit.ly/3mkcFys
Kotlin :- bit.ly/3GR2DOG

Пікірлер: 95
@ashutoshpalit2204
@ashutoshpalit2204 2 жыл бұрын
Its good that they have finally updated the switch statement syntax. Not that I had any issue with the previous syntax with break statement but now the arrow syntax definitely makes the code more readable and easier to write. And I just love the fact that they have added the return feature in switch, it makes a lot of things easier😁
@BruceWayneLive
@BruceWayneLive 3 ай бұрын
as an old school learner, the old switch syntax was cooler, no offence to the new learners.
@saishiny6684
@saishiny6684 11 ай бұрын
The way you explain is excellent sir. Iam very grateful to you sir.I hope one day I can explain like this to others.
@devanshusachdev7367
@devanshusachdev7367 Жыл бұрын
That's the benefit of following Navin sir's videos! Thank you sir for sharing :)
@codewithakram
@codewithakram 2 жыл бұрын
I like this syntax... Thanks for keep updating us.. i hope you will give such update in future also.
@shawngardiner2604
@shawngardiner2604 10 ай бұрын
Love the new switch syntax! Didn't have an issue with the old way as it is more expressive but this new way has certainly grown on me.
@MrKoniInTech
@MrKoniInTech 2 жыл бұрын
Love and respect from 🇨🇩🇨🇩🇨🇩 your channel has helped me a lot NAVIN.
@minor12828
@minor12828 Жыл бұрын
I like the switch updates. Thanks man 👍
@santoshram1241
@santoshram1241 Жыл бұрын
I liked it and felt more relevant than old syntax
@raghavsrivastava2910
@raghavsrivastava2910 2 жыл бұрын
Great features. Very informative video. 🔥
@user-ld7lg6ch2y
@user-ld7lg6ch2y 8 ай бұрын
Looks readable & amazing!!
@aniketankush218
@aniketankush218 2 ай бұрын
Yes, I enjoyed your video!
@buddareddycheppala3892
@buddareddycheppala3892 2 жыл бұрын
Really good future and thank you for explaining us
@sathishkumars373
@sathishkumars373 2 жыл бұрын
Thank you for your teaching
@ashleyleale6703
@ashleyleale6703 2 ай бұрын
Thank you I like the new update it helps me reduce the amount of text typed when coding.
@GoogleRalCoderHUB9905
@GoogleRalCoderHUB9905 5 ай бұрын
So Amazing teaching style sir thank you🎉🎉🎉🎉🎉
@22_ankanamajee97
@22_ankanamajee97 11 ай бұрын
very much liked this new switch case functions
@Ahmadzai-15
@Ahmadzai-15 Жыл бұрын
Amazing the new method 👍
@bhanuprakashreddy4834
@bhanuprakashreddy4834 10 ай бұрын
00:03 Updated version of switch statement in Java 01:32 Using switch statements in Java 02:55 Application to set alarms based on the day 04:19 Waking up schedule 05:42 Updated version of system.twintellin has new features. 07:04 Assigning a value to a variable instead of printing it directly 08:27 Using switch as an expression 09:51 Java 12 introduces the use of 'yield' instead of 'break' in switch statements
@fifaham
@fifaham 10 ай бұрын
I like the arrow operator, without the "break" statement. I see lots of similarities between C and Java, I am C embedded designer. I am planning to use Java for embedded (small computer forms - Microcontroller based) web servers. In your openion, what is a good Java flavor, library, extension and whatever that best fits for embedded designers? Is there a Java package that is dedicated mainly for embedded (hardware and software) designers? What is a good website that explores those possibilities? I am familiar with Eclipse, Andorid Studio, and many dedicated IDEs that belong to silicon manufacturers and their likes among IDEs - your help is greatly appreciated.
@kamakshijayaraman3747
@kamakshijayaraman3747 7 ай бұрын
i liked old switch statement
@monishas2474
@monishas2474 3 ай бұрын
When we need to write more than one line in cases,how can we use arrows sir.
@user-gp7xs8nr5i
@user-gp7xs8nr5i 11 ай бұрын
its good for understanding sir
@harikavaishnavi7957
@harikavaishnavi7957 14 күн бұрын
Thanks
@ramankaushish7720
@ramankaushish7720 2 жыл бұрын
It is actually great...
@venkatbalaga5892
@venkatbalaga5892 Жыл бұрын
Thank you so much sir ❣️
@lalit-singh-bisht
@lalit-singh-bisht 11 ай бұрын
do we have to write it in a block with there are multiple statements associated with a case
@sudharshan7203
@sudharshan7203 2 жыл бұрын
is this update a good way? In case I need to continue the block. what can I do in the update switch statement? I think this update is easy to write a code but how do we continue the block?
@Myworld-gb6rz
@Myworld-gb6rz 7 ай бұрын
thank u very much actually it's makes a sense
@108vicky
@108vicky 2 жыл бұрын
Nice tutorial
@MkTechriku
@MkTechriku 12 күн бұрын
Awesome
@VamsiYalamati
@VamsiYalamati Ай бұрын
THAT'S GREAT
@kartikeyanbagali1203
@kartikeyanbagali1203 Жыл бұрын
What if for each case we want to return different data types then how we can assign switch case to reference variable (result)
@pamusohith547
@pamusohith547 2 жыл бұрын
Thank you sir
@divergenny
@divergenny 2 жыл бұрын
Thank you
@bassenhancedmetal684
@bassenhancedmetal684 Жыл бұрын
Commenting for the algo. Quality content.
@AbdifitahAbdulkadir
@AbdifitahAbdulkadir 2 жыл бұрын
IT IS very good feature I like this new feature
@rishibose08
@rishibose08 8 ай бұрын
I like it.
@bhavinpatel1014
@bhavinpatel1014 4 ай бұрын
I loved the switch new syntax.
@fundango7690
@fundango7690 22 күн бұрын
its good
@giritalari793
@giritalari793 2 жыл бұрын
Great
@comelodian_corner_69
@comelodian_corner_69 5 ай бұрын
I actually like them both equally as being a beginner i have nothing to do with code optimisation while saving lines
@Him857
@Him857 2 жыл бұрын
I don't know but have gut feeling soon java will be standing next to python and R for ML or may be for block chain
@CodingBirdsOnline
@CodingBirdsOnline Жыл бұрын
java --version java 12.0.2 2019-07-16, I see java 12 in my system, but this syntax not working, getting an error.
@maheshBasavaraju
@maheshBasavaraju 2 жыл бұрын
I feel we don't need to put break at the end of case. Next case starting means end of the previous. Hope they remove that break without changing the syntax
@lakshmanabanki8900
@lakshmanabanki8900 2 жыл бұрын
Sir please make videos on frontend development using python programming .please sir
@BIT_RaginiV
@BIT_RaginiV 3 ай бұрын
after arrow operator , can we use compoud statement?
@chetanbharat6766
@chetanbharat6766 2 жыл бұрын
Is there any relationship with Lemda -> or switch ->
@dynamohack
@dynamohack 2 жыл бұрын
nice
@bro_chenzox
@bro_chenzox 8 ай бұрын
For Saturday and Sunday you set an alarm clock earlier than for weekday. Java developer as is.
@lathakarthikv1335
@lathakarthikv1335 8 ай бұрын
What if we want to have more than one statement in updated switch block..
@newworld8061
@newworld8061 11 ай бұрын
good
@deebaksharma7556
@deebaksharma7556 5 ай бұрын
Why it is not working in vs code?
@riswanahamed6224
@riswanahamed6224 3 ай бұрын
the format case "monday" -> output is not working ..showing like invalid syntax
@alexikamran7039
@alexikamran7039 Жыл бұрын
break seems like good for kick start/
@kumarmahendra2611
@kumarmahendra2611 2 жыл бұрын
What if we have to execute Multiple statements after -> or yeild ?
@teluskosupport1
@teluskosupport1 Жыл бұрын
for that simple use previous concept of switch;
@saurabhkumar-xm8wb
@saurabhkumar-xm8wb Жыл бұрын
Can we write multiple line statements in cases as we do in lambda expression using open close braces?
@hey-cg3fv
@hey-cg3fv Жыл бұрын
yes but use yield keyword
@kirillch
@kirillch Ай бұрын
🙌
@user-mv8vp1hf7j
@user-mv8vp1hf7j 7 ай бұрын
i think older version is good according to coding lines and syntax
@bswt002
@bswt002 11 ай бұрын
Where can I see new updates like this?
@7amalex763
@7amalex763 9 ай бұрын
It's definitely welcome feature to not have to declare a break statement on all my switch cases.
@rajualiendog8954
@rajualiendog8954 Жыл бұрын
Where you got updated these things sir
@nileshkumbhar1406
@nileshkumbhar1406 2 жыл бұрын
♥️
@ehteerk
@ehteerk 11 ай бұрын
why am I getting an error when using multiple cases in single case public class Main { public static void main(String[] args) { String d="f"; switch(d) { case "f", "m": System.out.println("work"); break; case "sat": System.out.println("gym"); } } } ERROR: Main.java:19: error: : expected case "f", "m": ^ 1 error
@ingenium8452
@ingenium8452 9 ай бұрын
i am not facing any issue bro public class hello{ public static void main(String[] args){ String d="f"; switch(d) { case "f", "m": System.out.println("work"); break; case "sat": System.out.println("gym"); } } }
@randomshorts1039
@randomshorts1039 2 жыл бұрын
finally, now they are adopting kotlin syntax.
@jebaranit4474
@jebaranit4474 6 ай бұрын
It’s similar to cpp(Most of the syntax)
@aruns6214
@aruns6214 Жыл бұрын
Sir we cant use switch statement in while loop because the break statement breaks entire looop😔😔
@commonman5768
@commonman5768 2 жыл бұрын
Hi sir, I'm stuck as software test engineer. I need to switch to development please suggest good path. I'm flexible in coding language
@bucztechph
@bucztechph Жыл бұрын
So basically they allow to put lambda expressions in switch case
@ilyabritkov2478
@ilyabritkov2478 11 ай бұрын
Sad that pattern Matching, gaurded Patterns and null-safe were not covered
@BakhtyarQadriCodeArtist
@BakhtyarQadriCodeArtist 2 ай бұрын
Correction: Strings are supported from Java 7
@curiosity6969
@curiosity6969 2 жыл бұрын
22 seconds of darkness at the end...
@Wanderer3639
@Wanderer3639 10 ай бұрын
I just learned you could use multiple conditionals for the same case... I just copied the code 2 times.
@MohaleMohale
@MohaleMohale 10 ай бұрын
Lessons are Good, may you please not blur the board!
@MarioBuchichio
@MarioBuchichio 11 ай бұрын
I never understood the concept of the old switch needing the break. I guess it serves a purpose for some people, but it makes no sense to me.
@nishantvijaybadgujar8857
@nishantvijaybadgujar8857 Ай бұрын
Nice feature😅
@faarouqasaju6023
@faarouqasaju6023 Жыл бұрын
I'd stick to the old syntax
@christcombiccombichrist2651
@christcombiccombichrist2651 8 ай бұрын
Shit java is too much every time I think I reach the end of a lesson , some new thing always comes up. I haven't gotten any where as yet to build a project. But any way I'll try.
@SatendraKumar2
@SatendraKumar2 4 ай бұрын
Coming from golang its normal but here looks like oracle or Java communities trying hard to catch up with modern language like go.
@subhajitbarh8435
@subhajitbarh8435 2 жыл бұрын
java is the new kotlin
@KarthiKeyan-ov3es
@KarthiKeyan-ov3es 2 жыл бұрын
Similar to kotlin
@vishwasrchonu7134
@vishwasrchonu7134 3 ай бұрын
Java is copying things from python and javascript, finally!! 😂😂😂
@deepadevi8911
@deepadevi8911 3 ай бұрын
Yeah it seems
@dracula9504
@dracula9504 Жыл бұрын
Better create new language for this. It makes java more complicated. This is good for intelligent people. How about the average? Maybe they have no right to become a developer.
@siva5258
@siva5258 9 ай бұрын
I think it's a good thing but old switch is better than this 😁
@shashanksinghsisodiya514
@shashanksinghsisodiya514 2 жыл бұрын
I don't even know Java 8 and Java is at v17🤦 after v100 Java will be rebranded to new jabaa language 😁😁
@fascinatingtop1015
@fascinatingtop1015 Сағат бұрын
Lol, thus python is good 🤣🤣
@adityabhardwaj9954
@adityabhardwaj9954 Жыл бұрын
This video series is unique but language problem 😢 Hindi or English mix rahta
@LeninEight
@LeninEight 8 ай бұрын
Thank you
@sushilrawal4888
@sushilrawal4888 2 жыл бұрын
Thanks sir
@lalitk7057
@lalitk7057 2 жыл бұрын
Great
#16 Need For Loop in Java
3:25
Telusko
Рет қаралды 98 М.
Stream API in Java
26:04
Telusko
Рет қаралды 301 М.
Can A Seed Grow In Your Nose? 🤔
00:33
Zack D. Films
Рет қаралды 29 МЛН
Secret Experiment Toothpaste Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 38 МЛН
Идеально повторил? Хотите вторую часть?
00:13
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 9 МЛН
Functional Interface | Lambda Expression in Java
13:56
Telusko
Рет қаралды 143 М.
#23 JDK JRE JVM in Java
5:22
Telusko
Рет қаралды 223 М.
#21 Class And Object Theory in Java
5:48
Telusko
Рет қаралды 212 М.
#17 While Loop in Java
12:28
Telusko
Рет қаралды 115 М.
#26 Stack And Heap in Java
12:37
Telusko
Рет қаралды 222 М.
#52 Method Overriding in Java
7:57
Telusko
Рет қаралды 125 М.
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 65 МЛН
Как противодействовать FPV дронам
44:34
Стратег Диванного Легиона
Рет қаралды 98 М.
Bluetooth connected successfully 💯💯
0:16
Blue ice Comedy
Рет қаралды 1,6 МЛН
Vision Pro наконец-то доработали! Но не Apple!
0:40
ÉЖИ АКСЁНОВ
Рет қаралды 453 М.