Explain If-else statement

If-else statement: It is a control structure employed to select between performing one of two alternative events.

    if(boolean-expression){
        // Statements performed whenever expression is true.
        ...
    }
    else{
        // Statements performed whenever expression is false.
        ...
    }

This is controlled by a Boolean expression.

   Related Questions in Programming Languages

  • Q : Explain Swing Swing : The Swing classes

    Swing: The Swing classes are portion of a wider collection termed as the Java Foundation Classes (abbreviated as JFC). The swing classes are stated in the javax.swing packages. They give a further set of components which extend the capabilities of Abs

  • Q : Inheritance in Object Oriented

    Q. What is the use of making a method private inside

  • Q : What is an Anonymous class Anonymous

    Anonymous class: It is a class formed without a class name. Such a class will be a sub class or an implementation of an interface, and is generally formed as an actual argument or returned as a method outcome. For example:

    Q : Explain Method overriding Method

    Method overriding: It is a method stated in a super class might be overridden by a method of similar name stated in a sub class. The two methods should have similar name and number and types of formal arguments. Any checked exception thrown by sub-cla

  • Q : What is Super type Super type : It is a

    Super type: It is a type with a child sub type. The sub-type or super-type relationship is more common than the sub-class or super-class relationship. An interface which is implemented by the class is a super type of the class. The interface which is

  • Q : Pointer in C What is pointer? What

    What is pointer? What significance of pointer in C programming languages?

  • Q : Describe Layout manager Layout manager

    Layout manager: The object responsible for sharing the accessible space between multiple components in a graphical container.

  • Q : Define the term Runtime error Define

    Define the term Runtime error: It is an error which causes a program to finish whenever it is being run.

  • Q : What is Hash function Hash function : A

    Hash function: A function employed to generate a hash code from the random contents of an object. The classes can override the hash Value method, inherited from the Object class, to state their own hash function.

©TutorsGlobe All rights reserved 2022-2023.