Java Switch Statements In Hindi

Switch Statement in Java in Hindi – Java In Hindi

Java

Switch Statement In Java in Hindi: Jab Kisi Program Me Bahut Sari If Condition Ka Istemal Karte Hai to Program Bahut Jyada Complex Ban Jata Hai jisse Samanjh Ne Me Jyada Dikkat Hoti Hai | Issi Se Bachne Ke Liye Ham Java Switch Statement in Hindi ko Istemal Karte Hai |

Yadi Aapne  HTML Full Course  And CSS Full Course And Python Full Course And PHP Full Course Nhi Read Kiya Hai To Aap Vah Bhi Read Kar Sakte Hai |

Switch Statement Java in Hindi

Switch Statement In Hindi Ek Conditional Branching Statement Hai Jiska Pryog Ek Variable Ki Value Ke Anushar Bahut Sare Case Ko Check Karne Ke Liye Kiya Jata Hai |

Iski Shurwat Mei Switch Statement In Hindi Ke Sath Ek Variable Hota Hai, Bich Mei Case Statement Ke Sath Bahut Sare Statement Block Hote Hai Or End Mei Default Statement Ke Sath Default Statement BLock Hota Hai |

Isme Shurwat Se Ek Ek Karke Variable Ki Value Ke Sath Sabhi Case Ko Check Kiya Jata Hai | Yadi Koi Bhi Case Variable Ki Value Se Match Karta Hai To Is Case Ke Under Likhe Statement Block Ko Execute Kiya Jata Hai | Or Yadi Koi Bhi Case Variable ki Value Se Match Nahi Karta Hai To End Mei Default Statement Block Ko Execute Kiya Jata Hai. Iska Syntax Aap Niche Dekh Sakte Hai |

Syntax:

switch(expression) {
  case a:
    // code block
    break;
  case b:
    // code block
    break;
  default:
    // code block
}

Aap Niche Diye Gaye Flow Chart Ko Dekh Kar Switch Statement in Java in Hindi Ko Understand Kar Sakte Hai |

Switch Statement In C++ & C In Hindi

Also ReadWhat is Java In Hindi

Example 1:

int day = 1;
switch (day) {
  case 1:
    System.out.println("Monday");
    break;
  case 2:
    System.out.println("Tuesday");
    break;
  case 3:
    System.out.println("Wednesday");
    break;
  case 4:
    System.out.println("Thursday");
    break;
  case 5:
    System.out.println("Friday");
    break;
  case 6:
    System.out.println("Saturday");
    break;
  case 7:
    System.out.println("Sunday");
    break;
  default:
    System.out.println("Error Input");
}

Output:

Monday

Input Me Hamne 1 Day Diya Hai Isliye Switch Case Ne Monday Print Kar Diya Hai. Lekin Agar Hamne 1 -7 Ke Alawa Kuch Or Input Dete Hai To Ye Case Default Me Jakar Error Input Print kar Dega

Also Read – Java If Else And Else If

Friends Mujhe Umeed Hai Ki Aapko Switch Statements In Java Ke Bare Mai 100% Jankari Ho Gayi Hogi | Agar Aapko Learn Karne Main Dikkat Aa Rahi Hai To Aap Mere Se Contact Kar Sakte Hai |

Leave a Reply

Your email address will not be published. Required fields are marked *