#13 If Else If in Java

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

Telusko

Telusko

Күн бұрын

Check out our courses:
Enterprise Java Spring Microservices: go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : go.telusko.com...
Coupon: TELUSKO20 (20% Discount)
For More Queries WhatsApp or Call on : +919008963671
Udemy Courses:
Spring: go.telusko.com...
Java:- go.telusko.com...
Java Spring:- go.telusko.com...
Java For Programmers:- go.telusko.com...
Python : go.telusko.com...
Git : go.telusko.com...
Docker : go.telusko.com...
website : courses.telusk...
In this lecture we are discussing:
1) what is if-else-if ladder?
2) syntax of if-else-if ladder
3) example of if-else-if
#1
-- if-else-if ladder is a series of if, else if or else statements that are executed based on the boolean condition.
-- if else if ladder is used to test multiple conditions
#2
syntax of if-else-if ladder
if(condition1)
{
//block of code
}
else if(condition2){
//block of code
}
else if(condition3)
{
//block of code
}
else{
//block of code
}
Note: only one block is executed from all. If all condition is false then else part executed
#3
-- check greatest number from three number.
int x=8;
int y=7;
int z=6;
if(x y && x z)
System.out.println("x is greater");
else if(y z)
System.out.println("y is greater");
else
System.out.println("z is greater");
Github repo : github.com/nav...
Java:- bit.ly/JavaUde...
Spring:- bit.ly/SpringU...
More Learning :
Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6
JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq
Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA
Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB
NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L
Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
www.telusko.com

Пікірлер: 15
@ArcturusWasTaken
@ArcturusWasTaken 5 ай бұрын
Sir really has the ability to explain well ❤ , Love the course so far, switching from JavaScript to Java, Very understandable, also i'd love if sir made some community for our questions ❤❤❤
@actandrepeat
@actandrepeat Жыл бұрын
Checking if the values are equal will make the program a bit faster. If you use if (x >= y && x >= z) and all three values are the same it will return x immediately instead of going to the else-if and then finally returning the z value from the last line which obviously is the same as x since x = y = z.
@AnuragRawat01
@AnuragRawat01 Жыл бұрын
Like this if(x>=y && x>=z) system.out.printli(x); else if(y>=z) system.out.printli(y); else system.out.printli(z);
@prabinkumar468
@prabinkumar468 Ай бұрын
Guys really awasome video , For the best video you can go to Ratan java or Navin Java ..........Both are Best in youtube world ...........Thank you Navin for wonderful video.
@f1rstmani624
@f1rstmani624 Жыл бұрын
U can also apply this approarc➡️ Declare max = x If (y>max) y=max If(z>max) z=max
@Uzumaki_tanjiro
@Uzumaki_tanjiro 6 ай бұрын
broo its correct but the topic is about if else if statements he just used that program as example to explain about the topic
@karthickm7776
@karthickm7776 Ай бұрын
hi sir. instead of using "double and method" i used if else method and and not used any "else if" . is it ok to follow this method or the method you used is more efficient in terms of time complexity and test cases? kindly reply sir. this is for interview purposes.
@Trunk_Tech
@Trunk_Tech Жыл бұрын
Hello sir, i would kindly request if you include assignments as we proceed with the tutorials. Thank You.
@KrishnaPatil-ks2vm
@KrishnaPatil-ks2vm 17 күн бұрын
For Those who don't understand why one of the condition from second if block removed and not an issue because ultimately we have to get the Highest Value among so it is not required to check for the value of X against as it is not the highest one. PS: I tried putting X value bigger than Y and we get the required results. Thank You!
@viratcreations867
@viratcreations867 Жыл бұрын
What happen if three values are same
@AnuragRawat01
@AnuragRawat01 Жыл бұрын
For that we have to make another logic if(x>=y && x>=z) system.out.printli(x); else if(y>=z) system.out.printli(y); else system.out.printli(z);
@TechNcookBook
@TechNcookBook 5 ай бұрын
Any reason for making these my videos sir
@ProgrammingWithDataSci
@ProgrammingWithDataSci 11 ай бұрын
its z not zee 😂
@vidyadharrao1894
@vidyadharrao1894 7 ай бұрын
play your comment
@nt0310
@nt0310 6 ай бұрын
Different places have different pronunciation hope you know that
#14 Ternary Operator in Java
4:39
Telusko
Рет қаралды 149 М.
#40 Encapsulation in Java
11:42
Telusko
Рет қаралды 183 М.
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
火影忍者一家
Рет қаралды 105 МЛН
How do Cats Eat Watermelon? 🍉
00:21
One More
Рет қаралды 12 МЛН
Man Mocks Wife's Exercise Routine, Faces Embarrassment at Work #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 6 МЛН
Players vs Corner Flags 🤯
00:28
LE FOOT EN VIDÉO
Рет қаралды 97 МЛН
#12 If else in Java
12:59
Telusko
Рет қаралды 159 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 238 М.
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,8 МЛН
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1,2 МЛН
#51 This and Super Method in Java
12:11
Telusko
Рет қаралды 114 М.
If Else Statement In Java Tutorial #17
7:39
Alex Lee
Рет қаралды 329 М.
#15 Switch Statement in Java
7:59
Telusko
Рет қаралды 152 М.
Object-Oriented Programming is Embarrassing: 4 Short Examples
28:03
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,2 МЛН
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
火影忍者一家
Рет қаралды 105 МЛН