java - What happens if I initialize an int variable to something other than an int? -


let's have following line of code:

int number = b/2;

where b odd int. happen?

also, if b instead long, java automatically convert long int? if b char, or else ridiculous?

java widen types automatically, must narrow types cast.

i suggest try might learn something. can't learn program without doing @ point.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -