Java Convert long to intWe can convert long to int in java using typecasting. To convert higher data type into lower, we need to perform typecasting. Typecasting in java is performed through typecast operator (datatype). Here, we are going to learn how to convert long primitive type into int and Long object into int. Java long to int ExampleLet's see the simple code to convert long to int in java. Test it NowOutput: 500 Java Long to int ExampleWe can convert Long object to int by intValue() method of Long class. Let's see the simple code to convert Long to int in java. Test it NowOutput: 10 Next TopicJava int to double |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India