Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Associate Certification (SCJA,OCAJ 5/6) and the fly likes primitives question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Associate Certification (SCJA,OCAJ 5/6)
Reply Bookmark "primitives question" Watch "primitives question" New topic
Author

primitives question

Michael Jackson
Greenhorn

Joined: Jun 29, 2010
Posts: 2
After many searches I keep coming up with mixed answers.

What are the integral types in Java?
byte,short,int,char

What are the numeric types in Java?
byte,short,int,long,char,float,double

Why is long left out of the integral type or did I read bad info?
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4967

Well, if you're reading older material, the long may not have been invented yet. Of course, you'd have to go a long way back to that time.

The integral types, that is, the ones that can be treated as whole numbers are byte, short, int, long and char.

The numeric types that can have decimals are the double and the float.

So, that pretty much covers it. long is definitely in there!


Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
Michael Jackson
Greenhorn

Joined: Jun 29, 2010
Posts: 2
Cameron Wallace McKenzie wrote:Well, if you're reading older material, the long may not have been invented yet. Of course, you'd have to go a long way back to that time.

The integral types, that is, the ones that can be treated as whole numbers are byte, short, int, long and char.

The numeric types that can have decimals are the double and the float.

So, that pretty much covers it. long is definitely in there!


Thanks Cameron I knew it made since to be in there but different places omitted it.

BTW I've really enjoyed your SCJA cert guide, my test is tomorrow afternoon just doing some last minute cramming!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: primitives question
 
Similar Threads
true/false
integral types
From marcus green
"is a" and "has a"
Java Integral Types