Java Convert int to longWe can convert int to long in java using assignment operator. There is nothing to do extra because lower type can be converted to higher type implicitly. It is also known as implicit type casting or type promotion. Java int to long ExampleLet's see the simple code to convert int to long in java. Test it NowOutput: 200 Java int to Long ExampleWe can convert int value to Long object by instantiating Long class or calling Long.valueOf() method. Let's see the simple code to convert int to Long in java. Test it NowOutput: 100 100 Next TopicJava long to int |
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