Facebook Twitter Instagram
    DeepCrazyWorld
    Facebook Twitter Instagram Pinterest YouTube
    • FLUTTER
      • FLUTTER APP
        • QRCode
        • Quiz App
        • Chat GPT
        • PDF App
        • News App
        • Fitness App
        • Weather App
        • BMI Calculator
        • GAME APP
        • Ecommerce App
        • wallpaper App
        • Finance app
        • Chat App
        • Wallet App
        • Taxi App
        • Quran app
        • Music player app
      • FLUTTER UI
        • Splash Screen
        • Onboarding Screen
        • Login Screen
        • Card Design
        • Drawer
    • PROJECT
      • Android Projects
      • College Projects
      • FLUTTER APP
      • Project Ideas
      • PHP Projects
      • Python Projects
    • SOURCE CODE
    • ANDROID
      • ANDROID APP
      • GAME APP
      • ANDROID STUDIO
    • MCQ
      • AKTU MCQ
        • RPA MCQ
        • COA MCQ
        • HPC MCQ
        • SPM MCQ
        • Renewable Energy All MCQ
        • Data Compression MCQ
        • Data Structure MCQ
        • Digital Image Processing MCQ
        • Software Engineering MCQ
        • Machine Learning MCQ
        • Artificial Intelligence MCQ
      • D PHARMA MCQ
        • Pharmaceutics – I MCQ
        • Pharmacognosy MCQ
        • Pharmaceutical Chemistry MCQ
        • Biochemistry and Clinical Pathology MCQ
        • Human Anatomy and Physiology MCQ
        • Heath Education and Community Pharmacy MCQ
    • INTERVIEW QUESTIONS
      • Flutter Interview Questions
      • INTERVIEW QUESTIONS
      • Python Interview Questions
      • Coding ninjas solution
    • MORE
      • WORDPRESS
        • SEO
        • TOP 10 WORDPRESS THEME
      • PRODUCTIVITY
      • Program
      • QUOTES
    DeepCrazyWorld
    Home»ANDROID STUDIO»OOP’s Concept Code – Basic operations and Relational Operators
    ANDROID STUDIO

    OOP’s Concept Code – Basic operations and Relational Operators

    DeepikaBy DeepikaFebruary 28, 2022Updated:February 28, 2022No Comments3 Mins Read

    OOP’s Concept Code – Basic operations and Relational Operators 2022 – Object means a real-world entity such as a pen, chair, table, computer, watch, etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects. It simplifies software development and maintenance by providing some concepts:

    • Object
    • Class
    • Inheritance
    • Polymorphism
    • Abstraction
    • Encapsulation


    Apart from these concepts, there are some other terms which are used in Object-Oriented design:

    • Coupling
    • Cohesion
    • Association
    • Aggregation
    • Composition

    <img decoding=

    Table of Contents

    Toggle
    • Basic operations
    • Relational Operators
    • Logical Operators
    • PROGRAM
    • READ MORE

    Basic operations

        Addition = +
        Subtraction "-"
        Multiplication "*"
        Division "/"
        Remainder = "what remains.." 4 % 2 = 0 because 2*2 = 4 and there's not remainder
        4%3 = 1

    Relational Operators

            == comparison, not assignment
            != NOT equal
            > greater than
            < less than
            >= Greater than or equal
            <= Less than or equal

    Logical Operators

            AND ( && ) == both "sides" need to be TRUE in order for the whole expression to return true
            OR ( || )
            NOT ( ! )

    PROGRAM

    package com.gohooljava.com;
    
    public class Main {
    
        public static void main(String[] args) {
    
            /*
               for loop
               while loop
             */
    
            int i = 0;
    
            while (i < 5) {
    
                System.out.println(" Counting.. " + i);
                i++;
    
            }
    
    
                // Make sure to uncomment the code in order to be able to run the program successfully :)
    
    //        for (int i = 0; i < 20; i++) {
    //
    //           //remainder ( %)
    //            if ( i % 4 == 0) {
    //
    //                System.out.println( i + " is a multiple of 4 ");
    //
    //            }
    //
    //
    //        }
    
    
    
    
    
    
    	  //Basic operations
            //Addition = +
            //Subtraction "-"
            //Multiplication "*"
            //Division "/"
            //Remainder = "what remains.." 4 % 2 = 0 because 2*2 = 4 and there's not remainder
            // 4%3 = 1
    
           int firstNum1 = 34;
           int secondNum2 = 3;
           System.out.println("The sum is +" (firstNum1 + secondNum2)); // Always add parenthesis in order for this to work
    
    // the "quotes are placed wrong as it gives the compilation error
    
    
           //Subtraction
           System.out.println("The result is +" (firstNum1 - secondNum2)); // Always add parenthesis in order for this to work
    
            //Multiplication
           System.out.println("The result is +" (firstNum1 * secondNum2));
    
            //Division
           System.out.println("The result is +" (firstNum1 / secondNum2));
    
            // ==== Relational Operators ===
            /*
               - == comparison, not assignment
               - != NOT equal
               - > greater than
               - < less than
               - >= Greater than or equal
               - <= Less than or equal
               ==== Logical Operators =====
                - AND ( && ) == both "sides" need to be TRUE in order for the whole expression to return true
                - OR ( || )
                - NOT ( ! )
             */
    //        double firstNum = 10;
    //        double secondNum = 3;
    //        double result = 0;
    //
    //        boolean isOld = true;
    //        boolean isYoung = false;
    //
    //
    //        if ( (isOld && !isYoung) && (firstNum < secondNum)  ) {
    //
    //            System.out.println("Horray!!");
    //
    //        }else {
    //
    //            System.out.println("Not right!");
    //
    //        }
    
    //        result = firstNum % secondNum;
    //
    //        // If statements
    //        if (firstNum <= secondNum) {
    //
    //
    //            System.out.println("The remainder is " + result );
    //
    //        }else {
    //
    //            System.out.println("Numbers aren't equal");
    //
    //        }
    
    
        }
    }

    READ MORE

    Share. Facebook Twitter LinkedIn WhatsApp Telegram Pinterest Reddit Email
    Previous ArticleHow to create Simple movie app with Source code 2023
    Next Article Top 5 Best Programming Languages To Learn in 2023

    Related Posts

    How to Make Car Racing Game App with Android Studio

    ANDROID 2 Mins Read

    Top 5 Best Programming Languages To Learn in 2023

    Program 7 Mins Read

    Java Program , Loop , Basic operations, Relational Operators

    ANDROID STUDIO 3 Mins Read

    Top 20+ Best Android app Project with Android Studio 2023

    Android Projects 4 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • Implementing a Dynamic FAQ Screen UI in Flutter Using ExpansionTile March 29, 2025
    • Creating an Instruction UI Screen in Flutter Application March 29, 2025
    • Animated Backgrounds in Flutter: A Complete Guide March 15, 2025
    • How to make Diary App using flutter stepwise using getx August 31, 2024
    • How to Create Music Player UI screen with fully functional in flutter August 30, 2024
    • How to make ListView Builder Ui in flutter with Source Code August 29, 2024
    • Create a TabBar View in flutter with fully functional stepwise August 28, 2024
    • How to create TabBar view in flutter with source code step wise August 27, 2024
    • How to make Heart rate measure app with Flutter stepwise August 26, 2024
    • How to make ChatGpt App in flutter with source code Stepwise August 25, 2024
    Facebook Twitter Instagram Pinterest YouTube
    • About
    • Contact
    • Disclaimer
    • Privacy Policy
    Copyright by DeepCrazyWorld © 2025

    Type above and press Enter to search. Press Esc to cancel.