Help with integer!


int is short for integer, which are all positive and negative numbers, including zero. This number could represent the number of visits a website has received or the number of programming languages you know.

This say integer is just for all positive and negative numbers, right? but why the here the INT have letters?

int myLuckyNumber = 7;

myLuckyNumber is the name of this INT?

thank you very much


A google search
== discussions / opinions ==
java what is an integer

java is java an interpreter


myLuckyNumber is indeed just the name of the variable, not the actual value itself. So ‘int’ is used to describe the type of the value.



Int here refers to the type of value stored. It doesn’t matter that the name is in alphabets. ( If think about it, it would be quite hard remembering variable names if they all were numbers!! )