Talk:Program name: Difference between revisions
Content added Content deleted
m (→Re-title?) |
|||
Line 11: | Line 11: | ||
:: Strange. It printed 'Test' yesterday when I tried it. But maybe I made a change to the code after that. I've added a body to new Object, now it works again. Anyway, the System.getProperty thing is even better. [[User:Fwend|Fwend]] 07:54, 6 August 2011 (UTC) |
:: Strange. It printed 'Test' yesterday when I tried it. But maybe I made a change to the code after that. I've added a body to new Object, now it works again. Anyway, the System.getProperty thing is even better. [[User:Fwend|Fwend]] 07:54, 6 August 2011 (UTC) |
||
:::I agree, it's pointless to hardcode the class and then ask for it as a string. Thanks Fwend and Mwn3d for correcting the example. --[[User:Mcandre]] |
:::I agree, it's pointless to hardcode the class and then ask for it as a string. Thanks Fwend and Mwn3d for correcting the example. --[[User:Mcandre]] |
||
:::I think it's still not right. The main method can be called from another class, since it's public. You could run the class Test2 which calls <code>Test.main(args)</code> in its main method. The desired output for this task would be "Test2" since that's the "script" that was run, but that example would still print "Test". --[[User:Mwn3d|Mwn3d]] 17:58, 6 August 2011 (UTC) |
::::I think it's still not right. The main method can be called from another class, since it's public. You could run the class Test2 which calls <code>Test.main(args)</code> in its main method. The desired output for this task would be "Test2" since that's the "script" that was run, but that example would still print "Test". --[[User:Mwn3d|Mwn3d]] 17:58, 6 August 2011 (UTC) |
||
::::: Then you'd be going out of your way to get the wrong result. The code should obviously be in the active main. [[User:Fwend|Fwend]] 23:15, 6 August 2011 (UTC) |
|||
==Question on the goal of the task== |
==Question on the goal of the task== |