title: In java, is it more efficient to use byte or short instead of int and float instead of double?
body: <p>I've noticed I've always used int and doubles no matter how small or big the number needs to be. So in java, is it more efficient to use <code>byte</code> or <code>short</code> instead of <code>int</code> and <code>float</code> instead of <code>double</code>?</p>
  
  <p>So assume I have a program with plenty of ints and doubles. Would it be worth going through and changing my ints to bytes or shorts if I knew the number would fit?</p>
  
  <p>I know java doesn't have unsigned types but is there anything extra I could do if I knew the number would be positive only?</p>
  
  <p>By efficient I mostly mean processing. I'd assume the garbage collector would be a lot faster if all the variables would be half size and that calculations would probably be somewhat faster too.
  ( I guess since I am working on android I need to somewhat worry about ram too)</p>
  
  <p>(I'd assume the garbage collector only deals with Objects and not primitive but still deletes all the primitives in abandoned objects right? )</p>
  
  <p>I tried it with a small android app I have but didn't really notice a difference at all. (Though I didn't "scientifically" measure anything.) </p>
  
  <p>Am I wrong in assuming it should be faster and more efficient? I'd hate to go through and change everything in a massive program to find out I wasted my time.</p>
  
  <p>Would it be worth doing from the beginning when I start a new project? (I mean I think every little bit would help but then again if so, why doesn't it seem like anyone does it.)</p>