permaculture playing cards
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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
subject: Integer data type
It's not a secret anymore!