Java Operators — தமிழ்

</>Coding Tamilan.← Java course & curriculum
Java Masterclass · Lesson 09 / 50 · தமிழ்

Java Operators

Turn values into expressions.

Step-by-step explanationsRunnable JavaPractice + answer

முக்கிய விளக்கங்கள் தமிழில் உள்ளன. Runnable example மற்றும் கூடுதல் practice notes ஆங்கிலத்தில் உள்ளன.

இந்தப் பாடத்தில்…

  • Explain the key idea behind Operators.
  • Read and run a complete example, then predict what changes.
  • Recognize the topic-specific mistake discussed below.
01 / The concept

அடிப்படையைப் புரிந்துகொள்ளுங்கள்

An expression combines values and operators to produce a result. The types of the operands matter: dividing two ints uses integer division, even if you assign the result to a double afterwards. Parentheses make your intended order explicit.

02 / Step by step

விரிவான விளக்கங்கள்

Java Operators என்னன்னு தெரியுமா?

Operators-ஐ use பண்ணி variables மற்றும் values-ல operations perform பண்ணலாம்.

Java-ல பல வகை operators இருக்கு:

  • Arithmetic operators — கணக்கு பண்றதுக்கு (+, -, *, /, %, ++, –)
  • Assignment operators — value assign பண்றதுக்கு (=, +=, -=, *=, /=)
  • Comparison operators — values compare பண்றதுக்கு (==, !=, >, <, >=, <=)
  • Logical operators — conditions combine பண்றதுக்கு (&&, ||, !)
  • Bitwise operators — bit-level operations-க்கு

Arithmetic Operators

Common arithmetic operators:

Operatorபெயர்Example
+Additionx + y
–Subtractionx – y
*Multiplicationx * y
/Divisionx / y
%Modulus (மீதி)x % y
++Increment++x
—Decrement–x

Compound Assignment Operators

OperatorExampleEquivalent toMeaning
+=x += 5x = x + 5Add and assign
-=x -= 3x = x - 3Subtract and assign
*=x *= 2x = x * 2Multiply and assign
/=x /= 4x = x / 4Divide and assign
%=x %= 3x = x % 3Modulus and assign

Ternary Operator

Java reference fragmentJAVA
int age = 20;
String status = (age >= 18) ? "Adult" : "Minor";
System.out.println(status);   // Adult

int a = 10, b = 25;
int max = (a > b) ? a : b;
System.out.println("Max: " + max);  // Max: 25

Java-வில் `==` operator objects-க்கு என்ன compare செய்யும்?

  1. Object-ன் content-ஐ compare செய்யும்
  2. Memory address (reference)-ஐ compare செய்யும்
  3. Object size-ஐ compare செய்யும்
  4. Object type-ஐ compare செய்யும்
Reveal answer / விடை

Memory address (reference)-ஐ compare செய்யும்

Objects-க்கு `==` memory reference compare செய்யும். Content compare செய்ய `.equals()` method பயன்படுத்தவும். Interview-ல் இது மிக முக்கியமான question!

03 / Read and predict

முழுமையான உதாரணம்

This complete Main.java program focuses on the lesson idea. Reference fragments above may demonstrate individual statements; this example includes the imports, entry point, and supporting types it needs.

Main.java · complete runnable exampleJAVA
public class Main {
    public static void main(String[] args) throws Exception {
        int total = 17;
        int groupSize = 5;
        System.out.println(total / groupSize);
        System.out.println(total % groupSize);
        System.out.println((double) total / groupSize);
    }
}
Predict first. Then reveal the expected output / வெளியீடு
3
2
3.4

The output shown was checked by running this complete example. Trace the executed statements in order, then compare with your run.

04 / Learn by changing

Change it. Run it. Understand it.

Load this lesson example into the editor. Change one value or statement, predict the result, then press RUN to execute Java.

Open Java editor ↗
After the editor loads, choose Load this lesson example, then press RUN.

Powered by OneCompiler. Code you run is sent to OneCompiler for execution. For Scanner examples, supply input in the editor I/O panel; for file examples, files exist in its execution environment.

05 / Your turn

நீங்களே முயற்சி செய்யுங்கள்

Practice challenge

Change total to 20 and predict the quotient and remainder.

Reveal the answer and reasoning / விடை

The integer quotient is 4, the remainder is 0, and the decimal division produces 4.0.

தவிர்க்க வேண்டிய தவறு: Use == for primitive equality checks, not =. Use equals when comparing String contents.

பாடத்தின் சுருக்கம்

  • Explain the example without reading the output first.
  • Make the change requested in the practice task.
  • Describe why the result changed—or why compilation failed.

Ready to move on? Follow the next lesson in course order, or return to the curriculum to review a prerequisite.

Coding Tamilan · Understand the idea. Try the code. Build the habit.