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

Inheritance In Java

  Inheritance Inheritance is a process or a mechanism where one class acquire the properties which include methods and fields of another class. With the use of this concept the information is made manageable in a hierarchical order. The class which inherits the properties of another class is known as subclass  or derived class or child class . and the class whose properties are inherited is called as base class or parent class . In java inheritance cannot be achieved until we use extends keyword. Reason to use Inheritance 1 For Method overriding 2 For code reusability  Syntax: class abc { ......... ......... } class xyz extends abc { ......... ......... } ---------------------------------------------------------------------------------------------------------------------------- Example //WAP to Demonstrate Inheritance............. import java.io.*; class Superclass { BufferedReader r=new BufferedReader(new InputStreamReader(System.in)); Double num1,num2; void get() { try

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