 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How can we bypass System.exit from executing? Can anyone help me with the question</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/</link>
	<description></description>
	<lastBuildDate>Sun, 26 May 2013 01:40:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: kinshu22</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110392</link>
		<dc:creator>kinshu22</dc:creator>
		<pubDate>Thu, 23 Aug 2012 17:18:19 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110392</guid>
		<description><![CDATA[I tried the below thing using SecurityManagerI tried the below thing using SecurityManager
public class t1{

static{
SecurityManager sm=new SecurityManager(){
public void checkExit(int exitCode){
System.out.println(&quot;Good Bye&quot;); /* Another way is to throw SecurityException over here. Then the finally block will execute but an exception will be thrown after that*/

}/*Overriding println method so that it will print false */
};
System.setSecurityManager(sm);
}
public static void main(String args[]){
try{
System.out.println(&quot;Welcome&quot;);
System.exit(0);
}
finally{
System.out.println(&quot;Good Bye&quot;);
}
}
}]]></description>
		<content:encoded><![CDATA[<p>I tried the below thing using SecurityManagerI tried the below thing using SecurityManager<br />
public class t1{</p>
<p>static{<br />
SecurityManager sm=new SecurityManager(){<br />
public void checkExit(int exitCode){<br />
System.out.println(&#8220;Good Bye&#8221;); /* Another way is to throw SecurityException over here. Then the finally block will execute but an exception will be thrown after that*/</p>
<p>}/*Overriding println method so that it will print false */<br />
};<br />
System.setSecurityManager(sm);<br />
}<br />
public static void main(String args[]){<br />
try{<br />
System.out.println(&#8220;Welcome&#8221;);<br />
System.exit(0);<br />
}<br />
finally{<br />
System.out.println(&#8220;Good Bye&#8221;);<br />
}<br />
}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kinshu22</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110391</link>
		<dc:creator>kinshu22</dc:creator>
		<pubDate>Thu, 23 Aug 2012 17:16:32 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110391</guid>
		<description><![CDATA[I tried in this way using SecurityManagerpublic class t1{static{SecurityManager sm=new SecurityManager(){public void checkExit(int exitCode){System.out.println(&quot;Good Bye&quot;); /* Another way is to throw SecurityException over here. Then the finally block will execute but an exception will be thrown after that*/}/*Overriding println method so that it will print false */};System.setSecurityManager(sm);}public static void main(String args[]){try{System.out.println(&quot;Welcome&quot;);System.exit(0);}finally{System.out.println(&quot;Good Bye&quot;);}}}]]></description>
		<content:encoded><![CDATA[<p>I tried in this way using SecurityManagerpublic class t1{static{SecurityManager sm=new SecurityManager(){public void checkExit(int exitCode){System.out.println(&#8220;Good Bye&#8221;); /* Another way is to throw SecurityException over here. Then the finally block will execute but an exception will be thrown after that*/}/*Overriding println method so that it will print false */};System.setSecurityManager(sm);}public static void main(String args[]){try{System.out.println(&#8220;Welcome&#8221;);System.exit(0);}finally{System.out.println(&#8220;Good Bye&#8221;);}}}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carlosdl</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110389</link>
		<dc:creator>carlosdl</dc:creator>
		<pubDate>Thu, 23 Aug 2012 16:07:15 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110389</guid>
		<description><![CDATA[I mentioned that because there is a Runtime method you can use to &quot;intercept&quot; the exit execution, from which you could do something before the VM actually goes down.]]></description>
		<content:encoded><![CDATA[<p>I mentioned that because there is a Runtime method you can use to &#8220;intercept&#8221; the exit execution, from which you could do something before the VM actually goes down.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carlosdl</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110388</link>
		<dc:creator>carlosdl</dc:creator>
		<pubDate>Thu, 23 Aug 2012 16:00:30 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110388</guid>
		<description><![CDATA[Is it really a requirement that the finally block be executed ?

How about doing something else but printing the desired text ?

Also, can you post what you tried with SecurityManager ?]]></description>
		<content:encoded><![CDATA[<p>Is it really a requirement that the finally block be executed ?</p>
<p>How about doing something else but printing the desired text ?</p>
<p>Also, can you post what you tried with SecurityManager ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kinshu22</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110382</link>
		<dc:creator>kinshu22</dc:creator>
		<pubDate>Thu, 23 Aug 2012 15:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110382</guid>
		<description><![CDATA[Yes. But you can add your own method or static block so that finally can run even after System.exit is called.]]></description>
		<content:encoded><![CDATA[<p>Yes. But you can add your own method or static block so that finally can run even after System.exit is called.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carlosdl</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110381</link>
		<dc:creator>carlosdl</dc:creator>
		<pubDate>Thu, 23 Aug 2012 15:09:39 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110381</guid>
		<description><![CDATA[So, you have to &quot;Re write the &lt;strike&gt;below &lt;/strike&gt;program&quot;, but you can&#039;t modify the main method, and the only method the program has is the &quot;main&quot; one.&#160; Is that right ?]]></description>
		<content:encoded><![CDATA[<p>So, you have to &#8220;Re write the <strike>below </strike>program&#8221;, but you can&#8217;t modify the main method, and the only method the program has is the &#8220;main&#8221; one.&nbsp; Is that right ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110367</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Thu, 23 Aug 2012 06:46:28 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110367</guid>
		<description><![CDATA[Ah. Okay, that makes more sense. Or at least it doesn&#039;t add a possible distraction.However, you should understand first that we don&#039;t answer interview (nor homework) questions. We can help guide the search for answers, usually by suggesting ideas or references that must be researched by the questioner. That ensures that future readers will also do their own research.Understood?Tom]]></description>
		<content:encoded><![CDATA[<p>Ah. Okay, that makes more sense. Or at least it doesn&#8217;t add a possible distraction.However, you should understand first that we don&#8217;t answer interview (nor homework) questions. We can help guide the search for answers, usually by suggesting ideas or references that must be researched by the questioner. That ensures that future readers will also do their own research.Understood?Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kinshu22</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110366</link>
		<dc:creator>kinshu22</dc:creator>
		<pubDate>Thu, 23 Aug 2012 06:13:04 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110366</guid>
		<description><![CDATA[Sorry. That was typo.. Corrected it.. I want to execute finally bock even after System.exit.]]></description>
		<content:encoded><![CDATA[<p>Sorry. That was typo.. Corrected it.. I want to execute finally bock even after System.exit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kinshu22</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110365</link>
		<dc:creator>kinshu22</dc:creator>
		<pubDate>Thu, 23 Aug 2012 06:10:41 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110365</guid>
		<description><![CDATA[Hi Tom.. Both the things are related. If you can tell me how can i bypass System.exit then by using it I can change the above program and I can print the expected output. Currently my program wont print &quot;Good Bye&quot; because of the use of System.exit]]></description>
		<content:encoded><![CDATA[<p>Hi Tom.. Both the things are related. If you can tell me how can i bypass System.exit then by using it I can change the above program and I can print the expected output. Currently my program wont print &#8220;Good Bye&#8221; because of the use of System.exit</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110364</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Thu, 23 Aug 2012 06:08:41 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/how-can-we-bypass-system-exit-from-executing-can-anyone-help-me-with-the-question/#comment-110364</guid>
		<description><![CDATA[Was that a typo where you wrote &quot;Good Byye&quot;? Maybe that&#039;s what confused me. It looked like you had some specific output that was different by adding an extra &quot;y&quot; from what was available in the code. -- Tom]]></description>
		<content:encoded><![CDATA[<p>Was that a typo where you wrote &#8220;Good Byye&#8221;? Maybe that&#8217;s what confused me. It looked like you had some specific output that was different by adding an extra &#8220;y&#8221; from what was available in the code. &#8212; Tom</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/10 queries in 0.045 seconds using memcached
Object Caching 393/399 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-26 05:53:22 -->