So i am trying to make a calculator with multiple classes, but iam stuck in a loop. when i try to get it to restart it gets stuck on one of the claculators. i want it to return to the main method.

Here is my main method
PHP Code:
import java.util.*;
public class main {

	
	public static void main(String[] args) {
		Scanner rstart = new Scanner(System.in);
		String restart;
		int y = 0;
		ifOption menuObject = new ifOption();
		do{
		menuObject.doReturn();
		System.out.println("Do you want to run the application agian? y/n");
		restart = rstart.next();
				if(restart.equals("n")){
					System.exit(0);
				}
		}
		while (y < 1);
	}

}

Here is the if statement method that selects the appropriate calculator
PHP Code:
import java.util.*;
class ifOption{	
			
	public void doReturn(){
		Practace twoObject = new Practace();
		calc threeObject = new calc();
		
		Scanner scan = new Scanner(System.in);
		
		int question;
		System.out.println("Do you want to maths 2 or 3 numbers?");
		question = scan.nextInt();
		
		if (question == 2){
			twoObject.twonum();
		}
		if (question == 2){
			threeObject.threenum();
		}
	}
		

	}
Here are my calculator classes
PHP Code:
import java.util.*;
import javax.swing.JOptionPane;

public class calc
				{
	
public void threenum(){
	Scanner m = new Scanner (System.in);
	Scanner s = new Scanner (System.in);
	
	
	int num1, num2, num3;
	
	
	String mod;
	String mod2;
	String r;   
	
	
	
		
	System.out.println("Please Enter 1st Number:");
	num1 = s.nextInt();
    System.out.println("Please enter *,/,-,+.");
    mod = m.next();
	System.out.println("Please Enter 2nd Number:");
    num2 = m.nextInt();
   
    
    
    
    if( mod.equals("+"))// addition 
    {
    	System.out.println("Please chose *,/,-,+.");
        mod2 = m.next();
        System.out.println("Please choses 3rd Number.");
        num3 = s.nextInt();
    	if(mod2.equals("+")){
    		JOptionPane.showMessageDialog(null,num1 + num2 + num3);
    	}
    	if(mod2.equals("-")){
    		JOptionPane.showMessageDialog(null,num1 + num2 - num3);
    	}
    	if(mod2.equals("/")){
    		JOptionPane.showMessageDialog(null,num1 + num2 / num3);
    	}
    	if(mod2.equals("*")){
    		
    		JOptionPane.showMessageDialog(null,num1 + num2 * num3);
    	}
    }
    
   
    if(mod.equals("-"))//subtaction
    {
    	
    	System.out.println("Please chose *,/,-,+.");
        mod2 = m.next();
        System.out.println("Please choses 3rd Number.");
        num3 = s.nextInt();
    	if(mod2.equals("+")){
    		JOptionPane.showMessageDialog(null,num1 - num2 + num3);
    	}
    	if(mod2.equals("-")){
    		JOptionPane.showMessageDialog(null,num1 - num2 - num3);
    	}
    	if(mod2.equals("/")){
    		JOptionPane.showMessageDialog(null,num1 - num2 / num3);
    	}
    	if(mod2.equals("*")){
    		JOptionPane.showMessageDialog(null,num1 - num2 * num3);
    	}
    }
	
    
    
    if(mod.equals("/"))//so on
	{
		System.out.println("Please chose *,/,-,+.");
	    mod2 = m.next();
	    System.out.println("Please choses 3rd Number.");
	    num3 = s.nextInt();
	    if(mod2.equals("+")){
	    	JOptionPane.showMessageDialog(null,num1 / num2 + num3);
    	}
    	if(mod2.equals("-")){
    		JOptionPane.showMessageDialog(null,num1 / num2 - num3);
    	}
    	if(mod2.equals("/")){
    		JOptionPane.showMessageDialog(null,num1 / num2 / num3);
    	}
    	if(mod2.equals("*")){
    		JOptionPane.showMessageDialog(null,num1 * num2 * num3);
    		
    	}
	}
	
    
    
    if(mod.equals("*"))//and so forth
	{
		System.out.println("Please chose *,/,-,+.");
	    mod2 = m.next();
	    System.out.println("Please choses 3rd Number.");
	    num3 = s.nextInt();
	    if(mod2.equals("+")){
	    	JOptionPane.showMessageDialog(null,num1 * num2 + num3);
    	}
    	if(mod2.equals("-")){
    		JOptionPane.showMessageDialog(null,num1 * num2 - num3);
    	}
    	if(mod2.equals("/")){
    		JOptionPane.showMessageDialog(null,num1 * num2 / num3);
    	}
    	if(mod2.equals("*")){
    		JOptionPane.showMessageDialog(null,num1 * num2 * num3);
    		
    	}
	}
	
  

	
	}

	
			}
and the other one.
PHP Code:
import java.util.*;
import javax.swing.JOptionPane;

public class Practace
				{
	
public void twonum()
			{
	
	Scanner m = new Scanner (System.in);
	Scanner s = new Scanner (System.in);
	
	
	int num1;
	int num2;
	
	String mod;
	String r;
	
	

	
		
	System.out.println("Please Enter 1st Number:");
	num1 = s.nextInt();
    System.out.println("Please enter *,/,-,+");
    mod = m.next();
	System.out.println("Please Enter 2nd Number:");
    num2 = s.nextInt();
    
    if(mod.equals("+"))// addition 
    {
    	JOptionPane.showMessageDialog(null,num1 + num2);
    }
    
    if(mod.equals("-"))//subtaction
    {
    	JOptionPane.showMessageDialog(null, num1 - num2);
    }
	if(mod.equals("/"))//so on
	{
		JOptionPane.showMessageDialog(null, num1 / num2);
	}
	if(mod.equals("*"))//and so forth
	{
		JOptionPane.showMessageDialog(null,num1 * num2);
	}
	
	

	}
	
			}