0

In Java, is there a performance difference between byte (keyword) and Byte (Object)?

package is.there.a.difference;

public class helpPlease {
    public Byte objectByte;
    public byte keywordByte;
}

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • 2
    There is no inherent performance of a thing. There is only performance if you do something with it; and the performance (and what that even means) depends on what specifically that something is. – Andy Turner Aug 01 '20 at 15:15
  • In other words, there is no difference in performance between byte and Byte if you don't do anything with them. If you did something with them, there might be. Can you maybe add a short program that shows how you use each type? – Joni Aug 01 '20 at 15:18
  • Generally, you want to use byte rather than Byte. If you need to represent a null value, you would use Byte. – Gilbert Le Blanc Aug 01 '20 at 16:19

0 Answers0