Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am stuck with the toString method of all classes please help By using Java Example of one of the classes: public class Add {

image text in transcribed

I am stuck with the toString method of all classes

please help

By using Java

Example of one of the classes:

public class Add {

private int num1 ;

private int num2;

public Add (int num1 , int num2)

{

this.num1 = num1 ;

this.num2 = num2 ;

}

public void setNum1 (int num1)

{

num1 =num1;

}

public void setNum2 (int num2)

{

num2 =num2;

}

public int getNum1 ()

{

return num1;

}

public int getNum2 ()

{

return num2;

}

public int addCal(int addResult)

{

return addResult = num1 + num2;

}

}

Add - num1:int - num2:int NumberDemo + main(args String[I) :void + toString0:String + sumO int Sub - num1 int - num2:int + toString():String + sub()int Number add: Addition -mul: Mul -sub: Sub +toString(): String +Number) Mul - num1: int - num2: int +tostring():String + mul():int

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Define Administration?

Answered: 1 week ago