Novice Java Tutorial with Apache NetBeans 11.0: 13 int and long primitive types

Опубликовано: 06 Июнь 2026
на канале: Bruce Lamb
8
0

Discuss a little more in depth about the int and long data type variables.
To copy and paste code visit: www.carbon12.life/Tutorials/Novice_Java/13_Primitive_Integer.php
Java Docs on primitive types: https://docs.oracle.com/javase/tutori...
ASCII Table: www.asciitable.com

Explain code declaring and assigning an int type. (0:19)

Run first example. (0:29)

Return to the java docs and explain more deeply about what is going on in an int type. (0:57)
int types take up 32 bits of ram. Memory is freed once program terminates.

Explain the long primitive type. (1:40)
The long type takes up 64 bits of ram and can represent a larger range of numbers.

Run the program with the long type declared. (2:16)

Explain the size difference and range between int and long. (2:55)

Last topic:
Assign a character literal 'F' to long type variable. 70 is returned back to console because that is the ASCII lookup reference. (4:03)

Reference the ASCII table (link is at top of page). (4:25)

Store a char type to an ASCII reference. (4:55)