0% found this document useful (0 votes)
21 views1 page

Operation

Uploaded by

Neha Vengurlekar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

Operation

Uploaded by

Neha Vengurlekar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

package ABC;

public class Operation {


// Method for addition
public int addition(int a, int b) {
return a + b;
}

// Method for subtraction


public int subtract(int a, int b) {
return a - b;
}

// Method for multiplication


public int multiply(int a, int b) {
return a * b;
}

// Method for division


public double divide(int a, int b) {
if (b == 0) {
System.out.println("Error: Division by zero!");
}
return (double) a / b;
}
}

You might also like