I\'m trying to write a program that reads an integer from the user (through the keyboard), adds 100 to it and displays the result. All I can do is get them to concatenate like 2
You are adding the wrong variable. Use this instead:
System.out.println(" Your value + 100 is " + ( 100 + number));
Text is the String, number an int, thus use:
System.out.println(" Your value + 100 is " + ( 100 + number));
For Strings + concatenates.
int number = Integer.parseInt(text) + 100;
System.out.println(" Your value + 100 is " + ( number));
or
System.out.println(" Your value + 100 is " + ( 100 + number));
For a string "+" works to concatenate , i.e append the string together :)