Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

#15 Switch Statement in Java

Автор: Telusko

Загружено: 2023-01-16

Просмотров: 287514

Описание:

Check out our courses:

Java Spring Boot AI Live Course: https://go.telusko.com/JavaSpringBootAI
Coupon: TELUSKO20 (20% Discount)

AI Powered DevOps with AWS - Live Course :- https://go.telusko.com/AIDevOps-AWS
Coupon: TELUSKO20 (20% Discount)

Master Java Spring Development : https://go.telusko.com/masterjava
Coupon: TELUSKO20 (20% Discount)

For More Queries WhatsApp or Call on : +919008963671

website : https://courses.telusko.com/


Udemy Courses:

Spring: https://go.telusko.com/udemyteluskosp...
Java:- https://go.telusko.com/udemyteluskojava
Java Spring:- https://go.telusko.com/Udemyjavaspring
Java For Programmers:- https://go.telusko.com/javaProgrammers
Python : https://go.telusko.com/udemyteluskopy...
Git : https://go.telusko.com/udemyteluskogit
Docker : https://go.telusko.com/udemyteluskodo...

Instagram :   / navinreddyofficial  
Linkedin :   / navinreddy20  
TELUSKO Android App : https://go.telusko.com/TELUSKOAPP
TELUSKO IOS App : https://apple.co/3SsgmU2
Discord :   / discord  

In this lecture we are discussing:
1) What is switch statement?
2) why we need switch statement?
3) What datatype can we use in switch?
4) Syntax of switch and example
5) Need of break
6) Need of default

#1
-- switch statement is a multiway branch statement that allows a variable to be tested for equality against a list of values
each value is called a case, and the variable being switched on is checked for each switch case.

#2
if we have multiple test cases and we want to test for a particular value then we can use switch statement.
At the place switch we can also use if-else-if ladder.

e.g
suppose user enter a your date of birth and we want to check from multiple year then
in this case we can use switch case.

#3
what dataType we can use in switch statement?
-- the switch statement can have a number of possible execution paths. A switch works with the
byte, short, char, and int primitive data types. It also works with enumerated types (discussed in Enum Types),
the String class, and a few special classes that wrap certain primitive types: Character, Byte, Short, and Integer.

#4
Syntax of Switch and example:
switch(variable){
case x1:
//code
break;

case x2:
//code
break;

default:
//code
}

example:
int x=9;
switch(x){
case 8:
System.out.println("8");
break;
case 7:
System.out.println("7");
break;
default:
System.out.println("No match found");
}

#5
Need of break
-- The break statements are necessary because without them, statements
in switch blocks fall through: All statements after the matching case label
are executed in sequence, regardless of the expression of subsequent case labels,
until a break statement is encountered. The program shows
statements in a switch block that fall through.

int x=5;
switch(x){
case 5:
System.out.println("five");
case 4:
System.out.println("six);
default:
System.out.println("default");
}

output:
five
six
default

Since, we are not using break after matching the case 5
it execute all remaining statements without check.

#6
Need of default:
The default section handles all values that are not explicitly handled by one of the case sections.

example:
int y=9;
switch(y){
case 8:
System.out.println("8");
break;
case 7:
System.out.println("7");
break;
}
In this case you don’t get any result because no case is match and
since no default case is available so, nothing we get.


Github repo : https://github.com/navinreddy20/Javac...


More Learning :

Java :- https://bit.ly/3x6rr0N
Python :- https://bit.ly/3GRc7JX
Django :- https://bit.ly/3MmoJK6

JavaScript :- https://bit.ly/3tiAlHo
Node JS :- https://bit.ly/3GT4liq

Rest Api :-https://bit.ly/3MjhZwt
Servlet :- https://bit.ly/3Q7eA7k
Spring Framework :- https://bit.ly/3xi7buh
Design Patterns in Java :- https://bit.ly/3MocXiq
Docker :- https://bit.ly/3xjWzLA

Blockchain Tutorial :- https://bit.ly/3NSbOkc
Corda Tutorial:- https://bit.ly/3thbUKa
Hyperledger Fabric :- https://bit.ly/38RZCRB

NoSQL Tutorial :- https://bit.ly/3aJpRuc
Mysql Tutorial :- https://bit.ly/3thpr4L

Data Structures using Java :- https://bit.ly/3MuJa7S
Git Tutorial :- https://bit.ly/3NXyCPu

Donation:
PayPal Id : navinreddy20
https://www.telusko.com

#15 Switch Statement in Java

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

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

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

#16 Need For Loop in Java

#16 Need For Loop in Java

#17 While Loop in Java

#17 While Loop in Java

Array vs. ArrayList in Java Tutorial - What's The Difference?

Array vs. ArrayList in Java Tutorial - What's The Difference?

Как Быстро ВЫУЧИТЬ Python в 2026 году

Как Быстро ВЫУЧИТЬ Python в 2026 году

Скоро начнётся пятый год войны | Зачем её вести дальше (English subtitles)

Скоро начнётся пятый год войны | Зачем её вести дальше (English subtitles)

Java Tutorial For beginners

Java Tutorial For beginners

Бывший рекрутер Google объясняет, почему «ложь» помогает получить работу.

Бывший рекрутер Google объясняет, почему «ложь» помогает получить работу.

Совет старика.

Совет старика.

Что с экономикой РФ? ФНБ на исходе, доходы рухнули, бизнес закрывается

Что с экономикой РФ? ФНБ на исходе, доходы рухнули, бизнес закрывается

Animation vs. Coding

Animation vs. Coding

#13 If Else If in Java

#13 If Else If in Java

Я наконец понял, как научиться программировать

Я наконец понял, как научиться программировать

Просто вставьте старые батарейки в дрель, и это нужно в каждом доме, но никто этого не делает!

Просто вставьте старые батарейки в дрель, и это нужно в каждом доме, но никто этого не делает!

CLEANER Anatoly CHALLENGED BODYBUILDERS | GYM PRANK

CLEANER Anatoly CHALLENGED BODYBUILDERS | GYM PRANK

Яйцу размером со шмеля нужна помощь, чтобы выжить.

Яйцу размером со шмеля нужна помощь, чтобы выжить.

#11 Логические операторы в Java

#11 Логические операторы в Java

Day 122 – Vibe Coding an App Until I Make $1,000,000 | Revenue: $36,078.29

Day 122 – Vibe Coding an App Until I Make $1,000,000 | Revenue: $36,078.29

Интервью: ребенок с СДВГ и ребенок без СДВГ

Интервью: ребенок с СДВГ и ребенок без СДВГ

#14 Ternary Operator in Java

#14 Ternary Operator in Java

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com