Java Tutorial For Beginners 10 - switch Statement in Java

preview_player
Показать описание
Java is a widely used robust technology. According to Estimates , 3 billion devices run java.

This Java Tutorial course is aimed at complete beginners to the subject. For those who have no programming experience or those who have limited knowledge of Java. We get you up and running and will give you the skills you need to master the Java programming language.
★★★Top Online Courses From ProgrammingKnowledge ★★★

★★★ Online Courses to learn ★★★

★★★ Follow ★★★

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!

java switch string
java switch enum
java switch example
java switch multiple case
java switch char
java switch string example
java switch case example
java switch int
Рекомендации по теме
Комментарии
Автор

Tried a calculator. Thanks for d videos.. i m a beginner and ur videos are loads of help. Thanks again.
import java.util.Scanner;
public class calculator {
public static void main(String[] args) {
// TODO Auto-generated method stub


System.out.println("+, -, *, /, %");


Scanner calc1= new Scanner(System.in);
System.out.println("x = ");
double first_number = calc1.nextDouble();

Scanner calc2= new Scanner(System.in);
System.out.println("y = ");
double second_number = calc2.nextDouble();

Scanner calc3 = new Scanner(System.in);
System.out.println("enter operator");
String total = calc3.nextLine();


switch (total){

case "+":
+ second_number);
break;

case "-":

- second_number);
break;

case "*":

* second_number);
break;

case "/":

/ second_number);
break;

case "%":

% second_number);
break;
}

}

}

sharmila
Автор

Really helpful videos!I speedrun these few starter videos cause i know C iam waiting for the good stuff !

hei
Автор

AS A BEGINNER IT WAS SO DIFFICULT TO READ TEXT BOOK...YOU MADE MY LIFE EASY

chaitanyateja
Автор

Hmm but can you make a case for example between 80 and 100 ? Supposing either the score will be 84/87/89 etc the output will be the same ?

TheSalads
Автор

// thanks for these videos brother
// very helpful for begginers
the

SRIJANSINGHRA
Автор

can we use a condition in switch case? like

switch(i){
case i>85 : System.out.println("A grade");
break;
case i>65 : System.out.println("b grade");
break;
case i>55 : System.out.println("c grade");
break;
case i>36: System.out.println("d grade");
break;
default : System.out.println("fail");

}

KOTHAABHISHEK
Автор

Hi there!
I like your tutorial, would you mind helping me in some of the problem solving in java

soladonga
Автор

My only question: did you change that battery in the smoke/CO2 sensor that was beeping in the background? :D

mikloskiraly
Автор

I like your tutorials. im not very good at english im from sweden :P we have java tutorials on swedish but i like your tutorials better! Keep it up! (Y)

jonaseriksson
Автор

I like your videos very much. Could you please do a program with entering the value of score as used before in Scanner scan and i need the video with more explanation of Scanner scan. Thank you very much.

aravindbasmi
Автор

Correction 1:34
The expression can be a *String* as well.

ruzainpatel
Автор

you good sir should make your way to the nearest hardware store and acquire batteries for your smoke detector
cheerio!

WockkyyySlush
Автор

Deine Sicherheitsalarm hat geringen Akku :-)

mohamadakkad
Автор

u need to change the batteries in your smoke detector

gavincoffield
Автор

Learn English and Java Basic -> Java master, all is free 10/10 ♥

-phamquangat
Автор

Can u give a range of possible outcomes in a single case... for eg. if u want to S.O.P Very good for any number between 90-100.
So what basically can u put condition in every case so that u could reduce the number of cases ?

adityapandey-pewo
Автор

Is switch good to use if you have multiple in variables?

devoiddude
Автор

Would creating separate packages for each lessons break anything?

haikusage
Автор

can we use > or < in switch case... for example :
case > 90:
System.out.println("Very Good");
break;

sitiaisyaibrahim
Автор

Brake...not this one but this one...break! XD

azverndias