Arithmetic Operators, Relational Operators, Logical Operators In Hindi

Arithmetic Operators, Relational Operators, Logical Operators In Hindi

जावा प्रोग्रामिंग लैंग्वेज में प्रोग्राम ऑपरेटर ऐसे रिजर्व्ड प्रोगाम सिंबल या स्पेशल करैक्टर होते हैं, जिनका यूज़ जावा डेवलपर द्वारा डिफाइन डिक्लेअर प्रोग्राम वेरिएबल और वैल्यू पर कस्टम एक्सप्रेशन कंडीशन या ऑपरेशन को परफॉर्म करने में किया जाता हैं। जावा लैंग्वेज  प्रोग्राम में यूज़ ऑपरेटर फंक्शन के आधार पर कई कैटेगरी में डिवाइड किया गया है। यहाँ हम जावा प्रोग्रामिंग में मोस्ट पॉपुलर अरिथमेटिक, रिलेशनल, और लॉजिकल ऑपरेटर्स, को बेहतर समझेंगे।

Arithmetic Operators, Relational Operators, Logical Operators In Hindi

So, let’s take a closer look at arithmetic, relational, and logical operators in Java programming.

  • अरिथमेटिक जावा ऑपरेटर।
  • रिलेशनल जावा ऑपरेटर।
  • लॉजिकल जावा ऑपरेटर।

Arithmetic Java operators.

जावा प्रोग्राम में अरिथमेटिक ऑपरेटर का यूज़ बेसिक मैथमेटिकल ऑपरेशन को अप्लाई करने में जैसे, ऐड, सब्सट्रैक्ट, मल्टिप्लाय, डिवाइड और मॉडुलुस जैसे ऑपरेशन को परफॉर्म करने में किया जाता है। जैसे, जावा में अरिथमेटिक ऑपरेटर int, float, double और long जैसे न्यूमेरिक डेटा टाइप वेरिएबल के साथ यूज़ किए जाते हैं।

Java Arithmetic Operator Details.

OperatorArithmetic Operators DescriptionExample
+Add arithmetic operator used to Add one or more integer value  p + q
Subtraction arithmetic operator used to subtract larger value with smaller valuep – q
*Multiplication arithmetic operator used to multiply two different integer valuep * q
/Division arithmetic operator used to divide large value with smaller numeric value integer or floating-pointp / q
%Modulus arithmetic operator used to get remainder of any value (it displays after division lager value with remainder)p % q

public class Main

{

            public static void main(String[] args) {

        int p = 25, q = 7;

        System.out.println(“The Addition of p & Q is – ” + (p + q));        // Result is – 25 + 7 = 32

        System.out.println(“The Subtraction of p & Q is – ” + (p – q));     // Result is – 25 – 7 = 18

        System.out.println(“The Multiplication of p & Q is – ” + (p * q));  // Result is – 25 * 7 = 175

        System.out.println(“The Division of p & Q is – ” + (p / q));        // Result is – 25 / 7 = 3 (integer division)

        System.out.println(“The Modulus of p & Q is – ” + (p % q));         // Result is – 25 % 7 = 4 (remainder)

            }

}

Element of Arithmetic Operator.

  • Division Arithmetic – यहाँ जब दोनों यूज़ होने वाले ऑपरेंड इन्टिजर वैल्यू होते हैं, तो इन्टिजर वैल्यू का डिवीज़न किया जाता है, जो डिवीज़न के समय रिमाइंडर वैल्यू को डिलीट कर देता है। यदि यहाँ आपके द्वारा कोई भी ऑपरेंड फ़्लोटिंग-पॉइंट टाइप जैसे फ़्लोट, डबल, डाटा टाइप फॉर्मेट में है, तो अरिथमेटिक ऑपरेटर रिजल्ट एक फ़्लोटिंग-पॉइंट नंबर में डिस्प्ले होगा।

Relational Java Operators.

जावा प्रोग्रामिंग लैंग्वेज में रिलेशनल ऑपरेटर का यूज़ प्रोग्रामर द्वारा डिफाइन दो इन्टिजर न्यूमेरिक वैल्यू लॉजिक या कस्टम कंडीशन एक्सप्रेशन को कम्पयेर करने में किया जाता है। रिलेशनल ऑपरेटर जावा में एक बूलियन वैल्यू के रिजल्ट को डिस्प्ले करते हैं, जो यूजर डिफाइन प्रोग्राम कंडीशन के अनुसार ट्रू या फाल्स हो सकता है। रिलेशनल ऑपरेटर जावा प्रोग्रामर को कुछ पर्टिकुलर डिसिशन क्रिएट करने या किसी प्रोग्राम के डिफ़ॉल्ट बिहेवियर फ्लो को कण्ट्रोल करने में हेल्पफुल होते हैं।

Relational Java Operators Details.

OperatorRelational Operators DescriptionExample
==Equal to Relational Operators used to equal one value to another valuep == q
!=Not equal to Relational Operators used to find out not equal program valuep != q
Greater than Relational Operators used to find out greater numeric value between two valuesp > q
Less than Relational Operators used to find out less than numeric value between two valuesp < q
>=Greater than or equal to Relational Operators used to check values is greater than or equal to value in programp >= q
<=Less than or equal to Relational Operators used to check given value is less than or equal to valuep <= q

Example of Relational Java Operators.

public class Main

{

            public static void main(String[] args) {

        int p = 7, q = 4;

        System.out.println(“The equal to value p == q – ” + (p == q));   // Result is – false

        System.out.println(“The not equal value  p != q – ” + (p != q));   // Result is – true

        System.out.println(“The greater than value p > q – ” + (p > q));     // Result is – true

        System.out.println(“The Less than value p < q – ” + (p < q));     // Result is – false

        System.out.println(“The greater than or equal to value p >= q – ” + (p >= q));   // Result is – true

        System.out.println(“The less than or equal to value p <= q – ” + (p <= q));   // Result is – false

            }

}

Element of Relational Java Operators.

जावा प्रोगाम में रिलेशनल ऑपरेटर सामान्य रूप से if-else ब्लॉक स्टेटमेंट्स कण्ट्रोल फ्लो, फॉर, व्हाइल या डू व्हाइल लूप्स, या किसी भी प्रकार के लॉजिकल वैल्यू को कम्पयेर  या डिसिशन लेने में हेल्प करते हैं।

Logical Java Operators.

जावा प्रोग्रामिंग लैंग्वेज में लॉजिकल ऑपरेटर्स का यूज़ बूलियन वैल्यू में लॉजिकल कंडीशन या ऑपरेशन को परफॉर्म करने में किया जाता है। जावा प्रोग्राम में लॉजिकल ऑपरेटर्स यूजर डिफाइन लॉजिक या कंडीशन को मैच या रिजेक्ट करते हैं, और दी गई प्रोग्राम में मल्टीप्ल कंडीशन के आधार पर प्रोग्राम के डिफ़ॉल्ट फ्लो को कंट्रोल करने में अधिक हेल्पफुल हैं।

Logical Java Operators Details.

OperatorLogical Operators DescriptionExample
&&Logical AND operator used to Returns true if both conditions are true in given programp && q
||Logical or operator used to display result true only one condition true in given expressionp || q
!Logical NOT operator used to Returns the Reverses the boolean value inverts!p

Example of Logical Java Operators.

public class Main

{

            public static void main(String[] args) {

        boolean p = true, q = false;

        System.out.println(“The logical AND operation is p && q – ” + (p && q));   // Result is – false (both condition must be true for AND)

        System.out.println(“The logical OR operation is p || q – ” + (p || q));   // Result is – true (only one condition must be true for OR)

        System.out.println(“The logical NOT operation is !p – ” + (!p));           // Result is – false (condition NOT reverses the boolean)

            }

}

Element of Logical Java Operators.

  • Logical AND (&&) operator – जावा प्रोगाम में लॉजिकल एंड ऑपरेटर सिर्फ़ तभी true रिजल्ट डिस्प्ले करता है, जब दिए गए दोनों ऑपरेंड एक समय में true वैल्यू हों।
  • Logical OR (||) operator – किसी जावा प्रोग्राम में यदि कोई भी एक ऑपरेंड वैल्यू true है, तो यह true रिजल्ट को प्रीव्यू करता है।
  • Logical NOT (!) operator – यह जावा प्रोग्राम में बूलियन वैल्यू को रिवर्स कर देता है, यदि यहाँ true वैल्यू है, तो ये इसे false कर और उसे रिवर्स कर देता है।

Combining Multiple Java Operators in an Expression.

किसी भी जावा प्रोग्राम में मल्टीप्ल लॉजिकल और अन्य ऑपरेटर्स कंडीशन एक्सप्रेशन को ऐड कर ज़्यादा काम्प्लेक्स कंडीशन और कैलकुलेशन डेवलप किए जा सकते हैं। जैसे, जावा प्रोग्रामर अरिथमेटिक, रिलेशनल, और लॉजिकल ऑपरेटर्स को एक साथ यूज़ कर एक ही प्रोग्राम में मल्टीप्ल ऑपरेटर कंडीशन को टेस्ट या एनालाइज कर सकते हैं।

Example of combining arithmetic, relational, and logical operators in a Java program.

public class Main

{

    public static void main(String[] args) {

        int p = 8, q = 16;

        boolean output;

        // here it Combined logical and relational operators together in single program

        output = (p < q) && (q > 12);  // here it display true (when both conditions must be true at a time)

        System.out.println(“Output of combined logical and relational opeator is – ” + output);

        // Combined arithmetic and relational operators

        boolean isGreater = (p * 4) > (q / 4);  // here is (16 > 8) -> true

        System.out.println(“Here Is p * 4 > q / 4 ? ” + isGreater);

    }

}

यहाँ लॉजिकल ऑपरेटर && का यूज़ दो रिलेशनल कंडीशन को ग्रुप करने में किया जाता है, और अरिथमेटिक ऑपरेटर का यूज़ कम्पयेर करने के लिए ज़रूरी कैलकुलेशन करने में  किया जाता है।

Detail Explanation abut Arithmetic Operators, Relational Operators, Logical Operators.

Operator TypeOperator symbolOperator Description
Arithmetic operator Add+Used to Addition two value
SubtractUsed to Subtraction two value
Multiply*Used to Multiplication two value
Division/Used to Division (integer or floating-point) two value
Modulus%Used to Modulus (remainder after division) two value
Relational operator Equal to==Used to find out Equal to two values
Not Equal!=Used to find out Not equal to value
Geater thanUsed to find out Greater than value
Less thanUsed to find out Less than value
Greater than or equal to>=Used to find out Greater than or equal to value
Less than or equal to<=Used to find out Less than or equal to value
Logical operator AND&&Logical AND must check both (both conditions must be true) at a same time
Logical OR||Logical OR must check one (one conditions must be true) at a time
Logical NOT!Logical NOT it reverse or (inverts the boolean value)

Arithmetic Operators, Relational Operators, Logical Operators Conclusion.

  • जावा प्रोग्राम में अरिथमेटिक ऑपरेटर का यूज़ बेसिक मैथ कैलकुलेशन करने में किया जाता हैं।
  • रिलेशनल ऑपरेटर का यूज़ जावा प्रोग्राम में दी गई वेरिएबल वैल्यू को कम्पयेर करने और उनके बीच रिलेशनशिप को डिफाइन करने में किया जाता है।
  • जावा प्रोग्राम में लॉजिकल ऑपरेटर का यूज़ मल्टीप्ल बूलियन कंडीशन एक्सप्रेशन को ग्रुप करने में किया जाता है, जो प्रोग्रामर द्वारा दी गई कंडीशन के आधार पर एक काम्प्लेक्स डिसिशन लेने में हेल्प करते हैं।

Leave a Reply