Convert string number to integer number [duplicate]

Use Wrapper Class.

Examples are below

int

int a = Integer.parseInt("1"); // Outputs 1

float

float a = Float.parseFloat("1"); // Outputs 1.0

double

double a = Double.parseDouble("1"); // Outputs 1.0

long

long a = Long.parseLong("1"); // Outputs 1

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)