I am stuck at exercise2


#1



how do i deal with int

public class DataTypes {
	public static void main(String[] args) {

		System.out.println();

	}
}


#2

Instruction:

Type any whole number in between the parentheses of System.out.println();

what is int?

  • int is short for integer, which are all positive and negative numbers, including zero.

  • The int data type only allows values between -2,147,483,648 and 2,147,483,647.


so you can write any value from -2,147,483,648 to 2,147,483,647 inside the parentheses of System.out.println(); like

System.out.println(5);

or

System.out.println(64971);


#3

even when i put a valid int within the parenthesis it still displays an error


#4

You should post your code with the valid int so we can review it.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.