Solved

convert Long to int

Posted on 2009-05-15
4
12,143 Views
Last Modified: 2013-11-23
is there a way to convert 'Long'  to int ?
0
Comment
Question by:bent27
4 Comments
 
LVL 9

Expert Comment

by:wellhole
ID: 24396774
Typecast it

int x = (int) y;
0
 
LVL 5

Accepted Solution

by:
Aanvik earned 500 total points
ID: 24396793
0
 
LVL 1

Expert Comment

by:codecaine
ID: 24832272
You don't really want to convert a long to a int because it loses true value. The only time you would want to cast is when the the other object can hold more data then the previous.
0
 

Expert Comment

by:ChantingWolf
ID: 25076852
good.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This video teaches viewers about errors in exception handling.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now