How to get answer 15 instead of 105 when user entered 10 as a number????? pls help!!!!!!
package userinputactivity;
import java.util.Scanner;
public class UserInputActivity {
public static void main(String[] args) {
Scanner name = new Scanner(System.in);
System.out.println("Please enter a number :");
int num2 = 5;
String num = name.next();
String total = (num + num2);
System.out.println("Answer is: " +total);
}
}