This should work but why does it not?
public class Main {
public static void main(String[] args) {
long num;
num = 3000000000; //3 billion
System.out.println("num is: " +num);
}
}
Output is an error that states: integer number too large. This is weird to me because even though I declared num as long and not int.
Java sees it as an int. Why?