Java traning


#1

Hi I am new to programming and never done it before. Just trying to learn basics. I am stuck on 2nd question
The first data type we will use is int.

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.
The int data type only allows values between -2,147,483,648 and 2,147,483,647.


#2

If you want anyone to be able to help you'll have to explain why you're stuck


#3

I am not able to understand interger


#4

Since you just pasted a description for "integer", you'll have to explain why that description was not understandable to you, how else will I know what you're missing?


#5

Integer is basically the same thing as int... But int is a i forgot the wording, its a reserved keyword of java, i think the world im looking is for reserved words?, but reserved words like int, double, you cant use much with popular classes.. For example:

ArrayLists cannot contain int data type, or double, or any of these reserved keywords.. its been kinda long(about 1.5ish week) since i did java. so im having those trouble to memory moments, but im 100% Sure you cant use int on Arraylist. And change your title to, What is Integer type in Java?


#6

System.out.println(-2,147,483,648); i put this in exercise and error showed up


#7

First of all dont put commas java dosent act like humans.. it does not like commas standing in front of numbers!... just do 214784343;

And Importantly why in the world, are you printing a very large number? Im sure this is not an exercice, are you trying to test this? Because this can possibly result in an overflow error which is if im not mistaken, too large of a number.


#8

It was a 2nd question in exercise but I put value and it work. Thanks. What are you suggesting that i should use smaller #s what size is the best


#9

lol dont ever say

.... Your never ever ever, gonna no what size you will be dealing with in the future. so be good on all of them basically xD. in C++, you deal with big integer using long long, and posive integer using unsigned int; and for short ones just do short int; But for Java im not to sure. Im kinda certain they have a long keyword for big numbers? Dont quote me on that one though,,


#10

Thank you for your help