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

Best Programming Language to learn in 2021

The main aptitude to learn in this day and age is to realize how to compose a PC program. Today, PCs have entered in pretty much every industry. Be it the autopilot in an airplane or advanced speedometer in your bicycle, PCs in different structures encompass us. PCs are incredibly valuable for an association to scale up well. Gone are the times of pen and paper. Today, to store and access your data, you totally need PCs. The programming and engineer networks are arising at a rate quicker than at any other time. Different new programming dialects are coming up that are appropriate for various classifications of designers (tenderfoots, middle, and specialists) just as for various use cases (web application, versatile applications, game turn of events, disseminated framework, and so forth) Each amateur is astounded with the inquiry, "What programming language would it be advisable for me to learn?" Types of Programming  1. Procedural Programming Languages This programming worldv

Java - Static variable, static method and static block with example.

Java Static keyword, Static method and Static block........ Questions.......?? 1) What is static keyword , static method() , static block 2) Define static keyword , static method() , static block 3) What do you mean by static keyword , static method() , static block 4)static keyword , static method() , static block in Java ?     1)Static Keyword:- Static keyword in Java Programming language is used for memory management purpose, it indicates that a particular member belong to a type itself, rather than to an instance of that type. As we mentioned above that is used for memory management purpose it means that static keyword gets memory once in the class which help in reduction of the memory, which makes the execution speed of the program fast which is a great advantage of the static keyword. let's take example how static keyword works..... firstly we will see how memory get wasted when we didn't use the static keyword. class company {  int emp_id; 

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 distinguished by a name. For the