#12 If else in Java

  Рет қаралды 122,446

Telusko

Telusko

Жыл бұрын

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
Udemy Courses:
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
Java For Programmers:- bit.ly/javaProgrammers
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusko.com/
In this lecture we are discussing:
1)What is conditional statements?
2)types of conditional statements
a) if-else
b) switch (next lecture)
c) ternary operator (next lecture)
d) nested if-else (next lecture)
e) if-else-if ladder (next lecture)
3)syntax of if-else
4)example on if-else condition
#1
-- conditional statement is a statement that can be true or false.
-- suppose if ask student is pass. (answer yes or no)
-- this type of statement of statement is conditional statement.
#2
In this part we are only discussing about if-else and
in next lecture we are discussing if-else-if ladder, ternary operator and switch statement.
#3
syntax of if-else
-- condition is either true or false after evaluation
-- remember like c and c++, we cannot use number directly as condition of if-else
- if(5) -- not allowed in java
-- you get Type mismatch: cannot convert from int to boolean
if(condition)
{
//code
//either this part execute
}
else
{
//code
//or this part execute
}
#4
example:
if want to check a given number is even or odd then;
int num=13;
if(num%2==0)
System.out.println("Even"); //here we not use braces for single statement {}
else
System.out.println("Odd"); // here we not use braces {}
Note: for single statement braces is not required but for multiple statement it is required.
Github repo : github.com/navinreddy20/Javac...
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
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

Пікірлер: 23
@ayodhyarode4522
@ayodhyarode4522 11 ай бұрын
I was thinking Java is difficult to learn. But you teach every concept friendly , like two friends are taking. Now I think Java is simple and fantastic programming language. Thank you 🙏 @navin reddy sir for teaching us java in simple way. My each concept of java is now clear.
@sriramb341
@sriramb341 5 ай бұрын
Java is easy if you are well versed in c or c++
@flymykim
@flymykim Жыл бұрын
"when you use else, there is a compulsion to use if." You have a very excellent way with words. It would be a crime if youre not a PHD. CS professor is one of your callings. Even the explanation of string immutability you have is excellent. Concise and also covering stack/heap memory. Perhaps the best explanations of java concepts on youtube.
@fezaiozcan2227
@fezaiozcan2227 11 ай бұрын
I am learning Java , i have tried many tutorials and these are the best ones. thanks
@user-rw7hb8mo8j
@user-rw7hb8mo8j Жыл бұрын
Its really good example you have explained very well. thanks for the video.
@yomnakamal4988
@yomnakamal4988 Жыл бұрын
Best java course i could find for free thank u soooo much
@debmalyamukherjee6332
@debmalyamukherjee6332 Жыл бұрын
Sir thanku so much for this new playlist.. I learn lot from this new playlist.. sir one request to you that plz make one new playlist like this on spring boot from basic to advanced.plzz sir
@PapuGhosh45
@PapuGhosh45 Жыл бұрын
thank you sir... . .... ..
@suryanaidu9193
@suryanaidu9193 Жыл бұрын
Thank you soo much Sir 😍❤️ For your videos and Efforts Sir 😍🥺 Can you please make Advance Java (jee).
@saiyadsakib5928
@saiyadsakib5928 Жыл бұрын
Yes sir..
@Vijay-zt4nx
@Vijay-zt4nx 11 ай бұрын
your class is simply super but small request from my side explain syntax along with the example, it will be more useful.
@venkycreations1079
@venkycreations1079 Жыл бұрын
how can i practice sir iam understood everything you tolled
@devanshusachdev7367
@devanshusachdev7367 11 ай бұрын
Notification: Marvel studios wants to know your location (5:55)
@christhelemaque4187
@christhelemaque4187 Жыл бұрын
Please sir update for SpringBOot
@abhishekbasu7837
@abhishekbasu7837 4 ай бұрын
Hi sir please make tutorial on Selenium with Java. For automation testing. Need your help
@quickkcare605
@quickkcare605 Жыл бұрын
Sir do an update for spring boot
@akshay7820
@akshay7820 Жыл бұрын
5:55 We don't do that here
@Caped_Crusader7
@Caped_Crusader7 Жыл бұрын
Do we not need curly brackets for if and else statements?
@Unknown-rt9vl
@Unknown-rt9vl Жыл бұрын
For larger Statment needed
@hritikyemde1014
@hritikyemde1014 Жыл бұрын
If your "if" or "else" block contains more than one statements then it requires curly braces, but if your "if" or "else" block contains single statement then it curly braces are optional
@AnuragRawat01
@AnuragRawat01 11 ай бұрын
When you have only one statement after the condition then it's optional to use curly brackets But when you have more than one statement after the condition then it becomes compulsion to use curly brackets 😃 Hope you understand it💯🙏
@yashparkhe5370
@yashparkhe5370 6 ай бұрын
We don't do that here 😂
#13 If Else If in Java
5:39
Telusko
Рет қаралды 92 М.
#11 Logical Operators in Java
11:17
Telusko
Рет қаралды 114 М.
Русалка
01:00
История одного вокалиста
Рет қаралды 5 МЛН
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 42 МЛН
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27
why are switch statements so HECKIN fast?
11:03
Low Level Learning
Рет қаралды 390 М.
Fastest Way to Learn ANY Programming Language: 80-20 rule
8:24
Sahil & Sarra
Рет қаралды 777 М.
Lecture 1: Introduction to CS and Programming Using Python
1:03:30
MIT OpenCourseWare
Рет қаралды 518 М.
Java if statements 🚧【6 minutes】
6:12
Bro Code
Рет қаралды 136 М.
#53 Packages in Java
12:20
Telusko
Рет қаралды 162 М.
How to Learn Complex Skills Quickly (And Forever)
17:14
Justin Sung
Рет қаралды 15 М.
Solve Any Pattern Question With This Trick!
57:20
Kunal Kushwaha
Рет қаралды 2,3 МЛН
Nesting "If Statements" Is Bad. Do This Instead.
1:00
Flutter Mapp
Рет қаралды 3,6 МЛН
#14 Ternary Operator in Java
4:39
Telusko
Рет қаралды 116 М.
YOTAPHONE 2 - СПУСТЯ 10 ЛЕТ
15:13
ЗЕ МАККЕРС
Рет қаралды 187 М.
WATERPROOF RATED IP-69🌧️#oppo #oppof27pro#oppoindia
0:10
Fivestar Mobile
Рет қаралды 17 МЛН
НЕ ПОКУПАЙ СМАРТФОН, ПОКА НЕ УЗНАЕШЬ ЭТО! Не ошибись с выбором…
15:23
Mastering Picture Editing: Zoom Tools Tutorial
0:52
Photoo Edit
Рет қаралды 505 М.