Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

convert Long to int

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
factorial example 4 48
Running JavaFX on JDeveloper 12C 1 55
Is Applet the way to go for my drag and drop system? 8 25
running on tomcat not jboss eap 7.0 3 18
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…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
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:

838 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