This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Integer data type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Integer data type" Watch "Integer data type" New topic

Integer data type

jaysingh solanki

Joined: Nov 11, 2003
Posts: 14
public class Lit{
public static void main(String[] argv){
int i = 18;
int j = 022;//Octal version: Two eights plus two
int k = 0x12;//Hex version: One sixteen plus two
long f=1.2L;
My Question:How i assign long value to f
if i put 1.2L or 1.2l it give
error Invalid character in number.
dennis zined
Ranch Hand

Joined: Mar 07, 2003
Posts: 330
long f=(long)1.2;

SCJP 1.4<br />SCWCD 1.4
It is sorta covered in the JavaRanch Style Guide.
subject: Integer data type
Similar Threads
Ambiguous Reference to method
A Programming Interview Question
Why the result of printing out the not-letter chars to console is different from to applets
About Overloaded Method?
Local Variables