Conditional Expression เคญी Control Flow Statements เค•ा เคนी เคเค• เคŸाเค‡เคช เคนै เค‡เคจเคฎे เคฎें เคญी conditions เคนी เคนोเคคी เคธिเคฐ्เคซ เคฅोเฅœा เคธिंเคŸेเค•्เคธ เคšेंเคœ เคนोเคคा เคนै
Conditional Expression เค•ा syntax เค•ुเค› เค‡เคธ เคช्เคฐเค•ाเคฐ เคนोเคคा เคนै

Condition ? expression1  : expression2

เค‡เคธเคฎें เคธुเคฐु เคฎें เคเค• condition เคฆी เคนुเคˆ เคนोเคคी เคนै เค”เคฐ เคฌाเคฆ เคฎें เคฆो expressions เคœैเคธा เค•ी เค†เคช เคŠเคชเคฐ เคฆेเค– เคนी เคธเค•เคคे เคนै เค•ोเคก เคฐเคจिंเค— เค•े เคฆौเคฐाเคจ เคฏเคฆि เค‡เคธเคฎें condition true เคนोเคคी เคนै เคคो first เคตाเคฒी เคเค•्เคธเคช्เคฐेเคถเคจ execute เคนो เคœाเคคी เคนै otherwise เคฆूเคธเคฐी expression execute เคนो เคœाเคคी เคนै เคšเคฒिเค เค‡เคธเค•ा เค•ोเคก เคฆेเค–เคคे เคนै --


Output
Conditional Expression Statements  เค•ा use  เค•เคฐเคจे เคธे code เค•ा syntax เคฅोเฅœा เคธ्เคฎाเคฒ เคนो เคœाเคคा เคนै เค‡เคธเคฒिเค เคนเคฎ เค‡เคธเค•ा use เค•เคฐเคคे เคนै otherwise เคฏे เค•ाเคฎ เคนเคฎ if-else เคธ्เคŸेเคŸเคฎेंเคŸ เค•े เคฆ्เคตाเคฐा เคญी เคชเคฐเคซॉเคฐ्เคฎ เค•เคฐ เคธเค•เคคे เคนै

เคเค• เคฆूเคธเคฐी เคคเคฐเคน เค•ी เค•ंเคกिเคถเคฏเคฒ เคเค•्เคธเคช्เคฐेเคถเคจ เค”เคฐ เคนोเคคी เคนै เคšเคฒीเคฏे เค‰เคธเค•ो เคญी เคฆेเค–เคคे เคนै ---

Expression1 ?? Expression2
เค‡เคธเคฎें เค…เค—เคฐ เคซเคฐ्เคธ्เคŸ เคเค•्เคธเคช्เคฐेเคถเคจ เค•ी เคตैเคฒ्เคฏू null เคจเคนीं เคนोเคคी เคคो เค‡เคธเค•ी เคตैเคฒ्เคฏू return เคนो  เคœाเคคी เคนै เค…เค—เคฐ เคซเคฐ्เคธ्เคŸ เคเค•्เคธเคช्เคฐेเคถเคจ เค•ी เคตैเคฒ्เคฏू null  เคนोเคคी เคนै เคคो เคธेเค•ंเคก เคเค•्เคธเคช्เคฐेเคถเคจ เค•ी เคตैเคฒ्เคฏू return เคนो เคœाเคคी เคนै  เคšเคฒिเค เค‡เคธเค•ो เค•ोเคก เคธे เคธเคฎเคเคคे เคนै


String name = "webstudy.in";

String Show = name??  "notfound";
print(Show);


เคœैเคธा เค•ी เค†เคช เคŠเคชเคฐ เคฆेเค– เคธเค•เคคे เคนै name เค•ी เคตैเคฒ्เคฏू null เคจเคนीं เคนै เค‡เคธเคฒिเค เค‡เคธเค•ी เคตैเคฒ्เคฏू webstudy.in  return เคนो เคœाเคเค—ी เคœिเคธเค•े เค•เคฐเคจा webstudy.in เคช्เคฐिंเคŸ เคนो เคœाเคฏेเค—ा เค…เคฌ เคฏเคฆि name เค•ी เคตैเคฒ्เคฏू null เคนोเคคी เคฎเคคเคฒเคฌ name เคธ्เคŸ्เคฐिंเค— variable เคฎें เค•ुเค› เคจ เคนोเคคा เคคो เค‡เคธเค•ी เคตैเคฒ्เคฏू null เคนोเคจे เค•े เค•ाเคฐเคฃ second เคเค•्เคธเคช्เคฐेเคถเคจ notfound return เคนो เคœाเคคा เคœिเคธเค•ी เคตเคœเคน เคธे notfound  เคช्เคฐिंเคŸ เคนो เคœाเคคा। เคšเคฒिเค เคนเคฎ เค‡เคจ เคฆोเคจों เค•ो เค•ोเคก เค•े เคฆ्เคตाเคฐा เคธเคฎเคเคคे เคนै

เค†เคˆเคฏे เคฆेเค–เคคे เคนै เคœเคฌ name เค•ी เคตैเคฒ्เคฏू null เคจเคนीं เคนै ---


Output




เค”เคฐ เคœเคฌ  name เค•ी เคตैเคฒ्เคฏू null เคนै ----




 Output


I hope เค†เคชเค•ो เคฏे tutorials เคธเคฎเค เคฎें เคœเคฐूเคฐ เค†เคฏा เคนोเค—ा। เค…เคฌ เค†เค—े เค•े tutorials เคฎें เคนเคฎ switch case statements เคฆेเค–เคจे เคตाเคฒे เคนै


Next--Dart Switch Case Statements

Previous





1 Comments

Post a Comment