java - How to add numbers onto the end of an int variable? -


how 1 update int variable within method input added end of int variable?

if wanted update value of combination after inputting 1, 2, 3, , 4, can variable hold value 1234?

this works,

int = 1; int j = 2; int k = integer.valueof(string.valueof(i) + string.valueof(j)); system.out.println(k); 

output 12


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -