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

Content deleted Content added
Line 112:
See http://msdn.microsoft.com/en-us/library/aa664638(v=VS.71).aspx
[[User:Useerup|Useerup]] ([[User talk:Useerup|talk]]) 17:28, 1 March 2012 (UTC)
 
Did you bother to try run that code using pointers? Try to compile this:
<code>
class Test
{
unsafe static void Main()
{
int i = 42;
int* p = &i;
Console.WriteLine(p.ToString()); // Operator '.' cannot be applied to operand of type 'int*'
new Stack<int*>().Push(p); //The type 'int*' may not be used as a type argument
new Stack().Push(p); //Argument 1: cannot convert from 'int*' to 'object'
}
}</code>
See http://msdn.microsoft.com/en-us/library/y31yhkeb(VS.90).aspx “Pointer types do not inherit from object and no conversions exist between pointer types and object. Also, boxing and unboxing do not support pointers.”
[[Special:Contributions/194.54.20.58|194.54.20.58]] ([[User talk:194.54.20.58|talk]]) 06:18, 2 March 2012 (UTC)
 
== Contradiction ==