Java + Convert Long To Int Code Example


Example 1: java long to int

public class LongToIntExample2{            	public static void main(String args[]){                    	Long l= new Long(10);         	int i=l.intValue();         	System.out.println(i);     	         }     }

Example 2: java long to integer

// auto-unboxing does not go from Long to int directly, so Integer i = (int) (long) theLong;

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable