Help with integer!


#1

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


#2

@megaslayer54768,
A google search
== discussions / opinions ==
java what is an integer site:stackoverflow.com
http://stackoverflow.com/questions/564/what-is-the-difference-between-an-int-and-an-integer-in-java-and-c

java is java an interpreter site:stackoverflow.com
http://stackoverflow.com/questions/3180456/java-compiler-interpreter


#3

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.


#4

Hi!

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!! )

-PythonMaster