Skip to main content

Decision Making Statements in Java Programming Language.

 Their are 3 decision making statement in Java.

Here where ever you find the if underlined like this(if)

then it is related to statement.

1) if statement.

2) if else statement.

3) if-else-if statement.

So lets discuss one by one about each statement.

1) if statement:- if statement is used in programming for checking the given condition is true or not. If the condition in the if block is true then the block executes otherwise the programme terminates.

Lets understand it by its syntax.


 




Here in the syntax we have condition in the if block, if the the condition which we have putted is true then the code which is written in the block will executes otherwise the programme ends their. 

2) if else statement:- if else statement is used in programming for checking the given condition is true or false. If the condition is true then the if block is executed otherwise the else block is executed.

Lets understand it by its syntax.









Here in the syntax a condition is given in the if statement, if the condition is true then the if block will be executed otherwise the else block will be executed as the condition is false in the if block.

3) if-else-if statement:- if-else-if statement is used in programming language for checking given condition. If the condition is true then the if block will be executed, if the condition is false but the condition present in the else if block is true then the else if block will be executed otherwise else block will be executed.

Lets understand it by its syntax.








Here in the syntax a condition is given in if block if the condition is true then the if statement will get executed, but if the condition is false then the compiler will move toward else if block, if the condition is true then the else if statement will get executed but if both the condition are false then else block will get executed.

Comments

  1. Jamao kara lagla mantat ravi tu tar

    ReplyDelete
  2. Well done keep it up bhai๐Ÿ‘๐Ÿ‘๐Ÿ‘

    ReplyDelete
  3. Bro my concept are cleared after reading your blogs keep making blog like this๐Ÿ˜ƒ๐Ÿ˜ƒkeep it up

    ReplyDelete
  4. Replies
    1. Yes bro definately I will make firstly my main focus is on java programming.

      Delete
  5. Abe ravya mahol kru rahila Tu tr๐Ÿ‘๐Ÿค˜๐ŸคŸ

    ReplyDelete
  6. Ravi sir yancha Vijay aso yenarya nivadnuk mdhe๐Ÿ˜Ž๐Ÿ’ช

    ReplyDelete
  7. OP Bhai๐Ÿค˜๐ŸคŸ๐Ÿ‘๐Ÿ’ช

    ReplyDelete
  8. minecraft coding Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info.

    ReplyDelete

Post a Comment

Popular posts from this blog

What is Procedural Programming Language(PPL)

  Procedural Programming Language. Procedural Programming might be the primary programming worldview that another engineer will learn. Essentially, the procedural code is the one that straightforwardly trains a gadget on the best way to complete an errand in consistent advances. This worldview utilizes a direct top-down methodology and treats information and techniques as two distinct elements. In view of the idea of a methodology call, Procedural Programming isolates the program into strategies, which are otherwise called schedules or capacities, just containing a progression of steps to be done.  Basically, Procedural Programming includes recording a rundown of directions to mention to the PC what it ought to do bit by bit to complete the job needing to be done.  Key Highlights of Procedural Programming  The vital highlights of procedural writing computer programs are given underneath:  1)Predefined capacities: A predefined work is normally a guidance distingu...

Packages In Java

  Package in java is a group of similar type of classes, interface and sub-package. Packages in java can be defined in two ways which are 1 Built-in Packages 2 User-defined Packages Built-in Packages are       * Lang      * Util      * io      * awt      * net      * applet, etc. User-defined packages can be anything which are created by the user. Packages are nothing but container of the classes which store the no of classes, interface and their methods. Advantages of Packages 1 It provide access Protection 2 It removes the naming collision 3 it is used to categorize the classes and interface so that they can be easily maintained. Steps for creating a package Step-1 Create a folder in any drive of your choice  Step-2 example in d: package1 (it is the name of the package) Step-3 Open the java application and type the following code package package1; public class demo {  publ...