Content deleted Content added
m Dating comment by 77.12.173.11 - "→boolean, byte, and short in constant pool: " |
|||
Line 59:
Since the Java bytecode makes no difference between these integral types, all int values fitting into the short value range are encoded this way. Only values outside this range or needed for initializing compile-time constants (e.g. static final fields) will end up in the constant pool. <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/77.188.94.56|77.188.94.56]] ([[User talk:77.188.94.56|talk]]) 15:56, 22 February 2011 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
: Indeed, byte, short, and smaller char constant values used in the code will never appear in the constant pool (and maybe this is worth mentioning in the article). But for other uses of constant pool entries, e.g. the compile-time values of static final variables, these types require an int entry. There is another difference between the general class file format and the byte code instructions: as the article states, there’s no padding in the class file format, but within byte code instructions there is an exception to this rule regarding the two switch instructions as their tables are aligned. [[Special:Contributions/77.12.173.11|77.12.173.11]] ([[User talk:77.12.173.11|talk]]) <span style="font-size: smaller;" class="autosigned"> — Preceding [[Wikipedia:Signatures|undated]] comment added 09:40, 16 April 2014 (UTC)</span><!--Template:Undated--> <!--Autosigned by SineBot-->
|