Talk:Comparison of C Sharp and Java: Difference between revisions

Content deleted Content added
SineBot (talk | contribs)
m Signing comment by 76.23.17.34 - "Response: "
No edit summary
Line 17:
 
I tidied up these sections as there was some glaring misconceptions (delegates, events, closures and observer pattern were all lumped together) and some NPOV issues ("plain, old object-oriented design"). <small><span class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Useerup|Useerup]] ([[User talk:Useerup|talk]] • [[Special:Contributions/Useerup|contribs]]) 04:54, 18 May 2010 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
 
== Conditional Compilation ==
 
Java ''does'' support conditional compilation, in the form:
 
<syntaxhighlight lang="java">
if (CONDITION) {
// conditional code
}
</syntaxhighlight>
Where ''CONDITION'' is an expression that can be evaluated at runtime (for example, using a static-final boolean). If ''CONDITION'' is true, the "if" portion of the code will be removed, and only the body left. If false, the entire block, will be removed.
 
This is not simply a matter of the compiler performing an optimization. The usual Java "no unreachable code" rule is suspended in this situation specifically so it can be used for conditional compilation. <ref name="Java Language Specification">{{cite web|url=http://java.sun.com/docs/books/jls/third_edition/html/statements.html#14.21 |title=Java Language Specification" |___location="14.21 Unreachable Statements"}}</ref>
[[User:Spockwithabeard|Spockwithabeard]] ([[User talk:Spockwithabeard|talk]]) 18:25, 13 February 2011 (UTC)
 
== Instance Initializers ==