Solved

convert Long to int

Posted on 2009-05-15
4
12,145 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java Server Faces parameter pass? 6 50
eclipse argument 14 60
jdbc error in jsp application 20 45
hibernate jars 4 30
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…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

770 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