Content deleted Content added
m fix |
→Java unsigned integer type "char"?: new section |
||
Line 578:
:You could have added '''un''' instead of removing the whole section. So your reason for removing it must be something else. I'm not sure whether this discussion should be present. Is discussing the ''consequences'' of diffferences between the languages too far beyond the scope of this article? [[User:Rp|Rp]] ([[User talk:Rp|talk]]) 21:27, 27 May 2011 (UTC)
::Actually criticism in the section is specifically about checked exceptions. There is no contract-breaking change if you throw a different unchecked exception, as you are always allowed to throw ''any'' unchecked exception type from within any method, so the section just doesn't make sense if you add ''un''. And, yes, maybe the appropriate place for that is [[Exception handling#Checked exceptions]]. --[[Special:Contributions/151.75.16.218|151.75.16.218]] ([[User talk:151.75.16.218|talk]]) 00:15, 28 May 2011 (UTC)
== Java unsigned integer type "char"? ==
I reverted an edit claiming that the Java <code>char</code> type is an "unsigned 16 bit integer" type. According to the language spec it is an ''integral type'' which as soon as it is used with a numeric operator (such as bitwise shift, -and and -or ) it gets ''promoted'' to an integer. So the <code>char</code> type is not an integer type, neither formally nor practically. It is a separate integral type which is ''convertible'' to integer but is itself not an integer. Please read chapter 5 of the Java Language Specification if in doubt.
|