Can any help me with this code, im trying to get the program to return to a function. I have no idea how this is done. Give a lil explanation so I know for next time. Thanks here the code :
// The "Calculator" class.
import java.awt.*;
import hsa.Console;
public class Test
{
static Console c;
static public void main (String [] args)
{
c = new Console ();
int choice;
c.println ("choose one of the following");
c.println ("add ...1");
choice = c.readInt ();
if (choice == 1)
{
add (); // trying to go down to add function
}
static void int add (int a1, int a2, int total) // add function
{
c.println ("enter a number ");
a1 = c.readInt ();
c.println ("enter another number ");
a2 = c.readInt ();
total = a1 + a2;
c.println (total);
main (); // trying to go back to main
}
}