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

Java Class for Basic Arithmetic Operations

The document defines a Java class named CompleteClass with two private integer fields. It includes a default constructor and a parameterized constructor, as well as methods for addition, subtraction, and multiplication of two integers. However, there is a duplicate method named 'addition' that incorrectly performs division instead of addition.

Uploaded by

userprofession
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)
5 views1 page

Java Class for Basic Arithmetic Operations

The document defines a Java class named CompleteClass with two private integer fields. It includes a default constructor and a parameterized constructor, as well as methods for addition, subtraction, and multiplication of two integers. However, there is a duplicate method named 'addition' that incorrectly performs division instead of addition.

Uploaded by

userprofession
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

public class CompleteClass{

private int number1;


private int number2;

public CompleteClass() {}

public CompleteClass(int number1, int number2){


this.number1=number1;
this.number2=number2;
}

public void addition(int number1, int number2){


[Link](number1+number2);
}
public void substraction(int number1, int number2){
[Link](number1-number2);
}

public void multiplication(int number1, int number2){


[Link](number1*number2);
}

public void addition(int number1, int number2){


[Link](number1/number2);
}

You might also like