java check if a string can be converted to int code example Example: conversion of string to integer in java Integer.parseInt(str);