20. How to convert int to char.
💡Code:
public class IntToCharConversion7078 {
public static void main(String[] args) {
// Example int
int intValue = 65; // ASCII value for 'A'
// Convert int to char (explicit conversion with casting)
char charValue = (char) intValue;
// Print the converted char value
System.out.println("Converted char value: " + charValue);
}
}
📸Output :