Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

convert Long to int

Posted on 2009-05-15
4
Medium Priority
?
12,153 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

916 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