Computer Science, asked by sharmarahul5278, 1 year ago

How to convert an integer into character using scanner??

Answers

Answered by emani8888888
0

what are you trying to say .plzz be clear


sharmarahul5278: How to convert an integer literal into character??
sharmarahul5278: Like)
Answered by blackpinf4ever
0

public class StringToIntEx

{

public static void main (String[] args)

{

String s = "199";

try

{

int number = Integer.parseInt(s.trim());

System.out.println("number = " + number);

}

catch (NumberFormatException nfe)

{

System.out.println("NumberFormatException: " + nfe.getMessage());

}

}

}

Similar questions