16.How to convert long to int.
💡Code:
public class LongToIntConversion7078 {
public static void main(String[] args) {
// Example long
long longValue = 1234567890L;
// Convert long to int (explicit conversion with casting)
int intValue = (int) longValue;
// Print the converted int value
System.out.println("Converted int value: " + intValue);
}
}
📸Output :