Why can’t I have ‘int’ as the type of an ArrayList?

ArrayList can only reference types, not primitives. Integer is a class, not a primitive. When you declare ArrayList<Integer> list1 = new ArrayList<Integer>(), you’re creating an ArrayList which will store the Integer type, not the int primitive. If you want to read about the difference between primitive and reference types, check out http://pages.cs.wisc.edu/~hasti/cs302/examples/primitiveVsRef.html

How can I check if a string has a numeric value in it in Python? [duplicate]

Use the .isdigit() method: >>> ‘123’.isdigit() True >>> ‘1a23′.isdigit() False Quoting the documentation: Return true if all characters in the string are digits and there is at least one character, false otherwise. For unicode strings or Python 3 strings, you’ll need to use a more precise definition and use the unicode.isdecimal() / str.isdecimal() instead; not … Read more

How big can a 64bit signed integer be?

This article is good for more information about this topic: http://en.wikipedia.org/wiki/Integer_(computer_science) So the answer to the question should be: From -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807, or from −(2^63) to 2^63 − 1 The highest positive number stored in a signed int is represented binary as —– 63 ones —– 0111111111111111111111111111111111111111111111111111111111111111 If you think carefully you can find … Read more