Switch: If several options are available then it is not recommended to use if-else we should go for switch statement it improves readability of the code. Hi Semicolon( ) is a valid java statement which is call empty statement and it won' t produce any output. Without curly braces we can take only one statement under if, but it should not be declarative statement. Hi Both else part and curly braces are optional. Example 1:ĭURGASOFT, # 202,2ndFloor,HUDA M aitrivanam,Ameerpet, Hyderabad - 500038, Transfer statements o Break statement o Continue statement o Labeled break and continue statements o Do-while vs continue (The most dangerous combination) 88ĭURGASOFT, # 202,2ndFloor,HUDA M aitrivanam,Ameerpet, Hyderabad - 500038, The argument to the if statement should be Boolean by mistake if we are providing any other type we will get 'compile time error'.
For each Iterator Vs Iterable(1) Difference between Iterable and Iterator 4. For Loop Initilizationsection Conditional check Increment and decrement section Unreachable statement in for loop iv. Do-while Unreachable statement in do while iii. While loop Unreachable statement in while ii. Switch Case Summary fall-through inside a switch default case 3. DURGASOFT, # 202,2ndFloor,HUDA M aitrivanam,Ameerpet, Hyderabad - 500038, 86ĭURGASOFT, # 202,2ndFloor,HUDA M aitrivanam,Ameerpet, Hyderabad - 500038, Flow Control Agenda : 1.