New course! Every coder should learn Generative AI!
Try a free lesson+ 14
they are stored on stack , if they are not associated with object ie. defined locally
http://www.informit.com/articles/article.aspx?p=31755&seqNum=8
https://stackoverflow.com/questions/22779145/java-primitive-data-type-on-stack-or-heap