<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title><![CDATA[Java Programming Forums - The Java Community - Loops & Control Statements]]></title>
		<link>http://www.javaprogrammingforums.com/</link>
		<description>for loops, while loops, switch, if-then-else..</description>
		<language>en</language>
		<lastBuildDate>Wed, 19 Jun 2013 23:21:42 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.javaprogrammingforums.com/images/misc/rss.png</url>
			<title><![CDATA[Java Programming Forums - The Java Community - Loops & Control Statements]]></title>
			<link>http://www.javaprogrammingforums.com/</link>
		</image>
		<item>
			<title>Help with nested loops. So confusing.</title>
			<link>http://www.javaprogrammingforums.com/loops-control-statements/30075-help-nested-loops-so-confusing.html</link>
			<pubDate>Tue, 18 Jun 2013 20:01:03 GMT</pubDate>
			<description>So for some reason, the idea of nested for loops COMPLETELY blows my mind. Consider this following code I wrote(I wrote this through experimentation...</description>
			<content:encoded><![CDATA[<div>So for some reason, the idea of nested for loops COMPLETELY blows my mind. Consider this following code I wrote(I wrote this through experimentation and trial and error, I have no idea how it works.):<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">public class nestedloops {
&nbsp;
	/**
	 * @param args
	 */
	public static void main(String&#91;&#93; args) {
		for (int r = 1; r &lt;= 10; r++) {
			System.out.println();
			for (int c = 1; c &lt;= 10; c++) {
				int product = r * c;
				if (product &lt; 10) {
					System.out.print(&quot; &quot; + product + &quot; &quot;);
				} else {
					System.out.print(product + &quot; &quot;);
				}
&nbsp;
			}
		}
	}
}</pre></div></code><hr />
</div> Now I was wondering if someone could thoroughly explain to me how this works, what is does is print a multiplication table for the numbers 1 - 10, on a grid. I don't understand how it prints each line 1 - 9, and then the way it prints all the way down 10 times confuses my mind. I know this is a really big newbie question, but arrays have never been understood in my mind. Whoever can give me a nice explanation to this probably very simple problem, HUGE kudos to you :)</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/loops-control-statements/"><![CDATA[Loops & Control Statements]]></category>
			<dc:creator>abstractmind</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/loops-control-statements/30075-help-nested-loops-so-confusing.html</guid>
		</item>
		<item>
			<title>Best way avoiding ConcurrentModifications</title>
			<link>http://www.javaprogrammingforums.com/loops-control-statements/30000-best-way-avoiding-concurrentmodifications.html</link>
			<pubDate>Thu, 13 Jun 2013 18:09:44 GMT</pubDate>
			<description><![CDATA[Hey. 
 
I have a HashMap like this: 
HashMap<Player, Integer> players = new HashMap<Player, Integer>(); 
The int is for the amount of seconds the...]]></description>
			<content:encoded><![CDATA[<div>Hey.<br />
<br />
I have a HashMap like this:<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code Java:</div>
                <hr /><code class="bbcode_code"><div class="java" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">HashMap<span style="color: #000000;">&lt;</span>Player, Integer<span style="color: #000000;">&gt;</span> players <span style="color: #000000;">=</span> <span style="color: #7F0055; font-weight: bold;">new</span> HashMap<span style="color: #000000;">&lt;</span>Player, Integer<span style="color: #000000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span></pre></div></code><hr />
</div> <br />
The int is for the amount of seconds the player has left. Each second one second is removed from the person: (this is inside a thread)<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code Java:</div>
                <hr /><code class="bbcode_code"><div class="java" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7F0055; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #7F0055; font-weight: bold;">final</span> Iterator<span style="color: #000000;">&lt;</span>Player<span style="color: #000000;">&gt;</span> it <span style="color: #000000;">=</span> players.<span style="color: #000000;">keySet</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">iterator</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span> it.<span style="color: #000000;">hasNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #7F0055; font-weight: bold;">final</span> Player player <span style="color: #000000;">=</span> it.<span style="color: #000000;">next</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
&nbsp;
    <span style="color: #7F0055; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>player.<span style="color: #000000;">isOnline</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">int</span> seconds <span style="color: #000000;">=</span> getTimeLeft<span style="color: #000000;">&#40;</span>player<span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
&nbsp;
        <span style="color: #7F0055; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>seconds <span style="color: #000000;">&lt;=</span> <span style="color: #cc66cc;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #7F0055; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">!</span><span style="color: #000000;">&#40;</span>player.<span style="color: #000000;">isDead</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
                player.<span style="color: #000000;">setHealth</span><span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span> <span style="color: #3F7F5F; font-style: italic;">// This kills the player</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        setTimeLeft<span style="color: #000000;">&#40;</span>player, <span style="color: #000000;">--</span>seconds<span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
    <span style="color: #000000;">&#125;</span> <span style="color: #7F0055; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
        it.<span style="color: #000000;">remove</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></code><hr />
</div> <br />
If the player has 0 seconds or less, the player is killed and later runs a method to update everything correspondingly. The player can also die naturally, either by another player or from eg. starvation, so thats why I can't necessarily add the check directly to the thread / loop. This is the code which is run when the player dies:<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code Java:</div>
                <hr /><code class="bbcode_code"><div class="java" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7F0055; font-weight: bold;">public</span> <span style="color: #7F0055; font-weight: bold;">void</span> playerKilled<span style="color: #000000;">&#40;</span>Player player<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
        <span style="color: #3F7F5F; font-style: italic;">// Some validation before this</span>
        players.<span style="color: #000000;">remove</span><span style="color: #000000;">&#40;</span>player<span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
        spectators.<span style="color: #000000;">add</span><span style="color: #000000;">&#40;</span>player<span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></code><hr />
</div> <br />
The problem with this is that it always throws a <i>ConcurrentModificationException</i>. I changed the <i>HashMap</i> to <i>ConcurrentHashMap</i> and that fixed it, but that forces me add a ton of null checks everywhere and it ends up extremely ugly and occasionally fails for some reason.<br />
<br />
So the question is: What would be the best solution to avoid both of these errors while retaining the functionality?</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/loops-control-statements/"><![CDATA[Loops & Control Statements]]></category>
			<dc:creator>Jergetson</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/loops-control-statements/30000-best-way-avoiding-concurrentmodifications.html</guid>
		</item>
		<item>
			<title><![CDATA[Random Boolean in an if statement (tricky, can't seem to figure out)]]></title>
			<link>http://www.javaprogrammingforums.com/loops-control-statements/29730-random-boolean-if-statement-tricky-cant-seem-figure-out.html</link>
			<pubDate>Wed, 29 May 2013 01:37:18 GMT</pubDate>
			<description>Okay, so I have a class and in this class I have a method that runs a random boolean generator and I want to make it so that, depending on the value,...</description>
			<content:encoded><![CDATA[<div>Okay, so I have a class and in this class I have a method that runs a random boolean generator and I want to make it so that, depending on the value, it does one thing or the other. It's part of the battle class of my console game, Dungeoneer.(Which I will make a thread for soon, I may need help there lol).<br />
<br />
Anyhow, here is the current code, and it has a massive error that I can't seem to work around. Basically, I want<br />
to make the method blockCheck be a part of the battle system and essentially it works like this: &quot;if player block true then take no damage, else take random damage(which I'll make shortly).<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code Java:</div>
                <hr /><code class="bbcode_code"><div class="java" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7F0055; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Random</span><span style="color: #000000;">;</span>
&nbsp;
<span style="color: #3F7F5F; font-style: italic;">//This class is the battle system</span>
&nbsp;
<span style="color: #7F0055; font-weight: bold;">public</span> <span style="color: #7F0055; font-weight: bold;">class</span> Battle <span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #7F0055; font-weight: bold;">private</span> <span style="color: #7F0055; font-weight: bold;">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Arandom+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Random</span></a> rnd <span style="color: #000000;">=</span> <span style="color: #7F0055; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Arandom+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Random</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
&nbsp;
    <span style="color: #7F0055; font-weight: bold;">public</span> <span style="color: #7F0055; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">boolean</span> blockCheck<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
        <span style="color: #7F0055; font-weight: bold;">return</span> rnd.<span style="color: #000000;">nextBoolean</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
        <span style="color: #7F0055; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>blockCheck<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">==</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #3F7F5F; font-style: italic;">//TODO block code</span>
        <span style="color: #000000;">&#125;</span>
        <span style="color: #7F0055; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
           <span style="color: #3F7F5F; font-style: italic;">//TODO damage code</span>
&nbsp;
       <span style="color: #000000;">&#125;</span>
   <span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></code><hr />
</div> <br />
So, what can I do to make this if statement work without error(aside from actually putting code in it)?</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/loops-control-statements/"><![CDATA[Loops & Control Statements]]></category>
			<dc:creator>Xhalite</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/loops-control-statements/29730-random-boolean-if-statement-tricky-cant-seem-figure-out.html</guid>
		</item>
		<item>
			<title>Intersection of two loops</title>
			<link>http://www.javaprogrammingforums.com/loops-control-statements/29679-intersection-two-loops.html</link>
			<pubDate>Sun, 26 May 2013 16:48:20 GMT</pubDate>
			<description><![CDATA[Hi everybody!!! 
I want to get intersection of two loops. For example 
<div class="bbcode_container"> 
                 
<div...]]></description>
			<content:encoded><![CDATA[<div>Hi everybody!!!<br />
I want to get intersection of two loops. For example<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">class uniqueKey{
	public static void main(String args&#91;&#93;){
		for(int i=1;i&lt;10;i++){
			if(i==5 || i==6 || i==7)
				continue;
			System.out.println(i);
		}
	}
}</pre></div></code><hr />
</div> Out put of this code is<br />
1<br />
2<br />
3<br />
4<br />
8<br />
9<br />
Now scenario is something like this:<br />
Suppose 5,6 and 7 are coming from database in a while loop and we want to print only those values that are not coming from database say from 1 to 10. I tried a lot but no success. Plz help me in this regard.....</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/loops-control-statements/"><![CDATA[Loops & Control Statements]]></category>
			<dc:creator>sengreen</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/loops-control-statements/29679-intersection-two-loops.html</guid>
		</item>
		<item>
			<title><![CDATA[[SOLVED] A while-loop is SUPPOSED to replace a substring]]></title>
			<link>http://www.javaprogrammingforums.com/loops-control-statements/29648-while-loop-supposed-replace-substring.html</link>
			<pubDate>Fri, 24 May 2013 22:42:15 GMT</pubDate>
			<description><![CDATA[I notice that my method doesn't work even though I tried to get it's while-loop set-up to do the following things: 
 
 
1. Have each token of a...]]></description>
			<content:encoded><![CDATA[<div>I notice that my method doesn't work even though I tried to get it's while-loop set-up to do the following things:<br />
<br />
<ol class="decimal"><li style="">Have each token of a string get put into another one</li><li style="">Replace each given-substring (string2) with it's assigned-replacement (string3) as the string's (string1) tokens pass by</li><li style="">Have it's final answer returned as a variable to the main-method</li></ol><br />
<br />
Here is my code that has each of it's parts with a comment...<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code Java:</div>
                <hr /><code class="bbcode_code"><div class="java" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     <span style="color: #3F7F5F; font-style: italic;">// For the replacement of a substring with another one.</span>
     <span style="color: #7F0055; font-weight: bold;">public</span> <span style="color: #7F0055; font-weight: bold;">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> replaceSubstring<span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> string1, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> string2, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> string3<span style="color: #000000;">&#41;</span>
     <span style="color: #000000;">&#123;</span>
          Scanner keys <span style="color: #000000;">=</span> <span style="color: #7F0055; font-weight: bold;">new</span> Scanner<span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #000000;">in</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
&nbsp;
          <span style="color: #3F7F5F; font-style: italic;">// Use a StringTokenizer-object for breaking a string</span>
          <span style="color: #3F7F5F; font-style: italic;">// down to the point of finding that matching-substring</span>
          <span style="color: #3F7F5F; font-style: italic;">// in general.</span>
          <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astringtokenizer+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">StringTokenizer</span></a> numOne <span style="color: #000000;">=</span> <span style="color: #7F0055; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astringtokenizer+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">StringTokenizer</span></a><span style="color: #000000;">&#40;</span>string1, <span style="color: #0000ff;">&quot; &quot;</span>, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
          <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astringtokenizer+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">StringTokenizer</span></a> num1 <span style="color: #000000;">=</span> <span style="color: #7F0055; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astringtokenizer+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">StringTokenizer</span></a><span style="color: #000000;">&#40;</span>string1, <span style="color: #0000ff;">&quot; &quot;</span>, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
          <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astringtokenizer+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">StringTokenizer</span></a> numWon <span style="color: #000000;">=</span> <span style="color: #7F0055; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astringtokenizer+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">StringTokenizer</span></a><span style="color: #000000;">&#40;</span>string1, <span style="color: #0000ff;">&quot; &quot;</span>, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
&nbsp;
          <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> attacher <span style="color: #000000;">=</span> <span style="color: #7F0055; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
&nbsp;
          <span style="color: #3F7F5F; font-style: italic;">// Find the substring with the while-loop.</span>
          <span style="color: #7F0055; font-weight: bold;">while</span> <span style="color: #000000;">&#40;</span>numOne.<span style="color: #000000;">hasMoreTokens</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
          <span style="color: #000000;">&#123;</span>
               <span style="color: #7F0055; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>num1.<span style="color: #000000;">nextToken</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">==</span> string2<span style="color: #000000;">&#41;</span>
               <span style="color: #000000;">&#123;</span>
                    attacher <span style="color: #000000;">+=</span> string3<span style="color: #000000;">;</span>
               <span style="color: #000000;">&#125;</span>
               <span style="color: #7F0055; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>numWon.<span style="color: #000000;">nextToken</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">!=</span> string2<span style="color: #000000;">&#41;</span>
               <span style="color: #000000;">&#123;</span>
                    attacher <span style="color: #000000;">+=</span> numWon.<span style="color: #000000;">nextToken</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">;</span>
               <span style="color: #000000;">&#125;</span>
          <span style="color: #000000;">&#125;</span>
&nbsp;
          <span style="color: #3F7F5F; font-style: italic;">// Finally, return the String-object.</span>
          <span style="color: #7F0055; font-weight: bold;">return</span> attacher<span style="color: #000000;">;</span>
     <span style="color: #000000;">&#125;</span></pre></div></code><hr />
</div> <br />
...and here is the output-part I want to avoid at runtime.<br />
<br />
<div style="margin:20px; margin-top:5px">

	<div class="smallfont" style="height:27px; background-image: url('http://www.javaprogrammingforums.com/images/console.png'); background-repeat: no-repeat;">&nbsp;</div>

	<pre class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 1px;
		border: 1px solid;
                border-color: #99BAF3;
                background-color:white;
                white-space:nowrap;
		width: 754px;
		height: auto;
                min-height:100px;
		text-align: left;
		overflow: auto"><br />
Exception in thread &quot;main&quot; java.util.NoSuchElementException<br />
        at java.util.StringTokenizer.nextToken(StringTokenize  r.java:349)<br />
        at MiscellaneousStr.replaceSubstring(MiscellaneousStr  .java:93)<br />
        at MiscellaneousSDemo.main(MiscellaneousSDemo.java:84  )<br />
<br></br></pre>
</div><br />
<br />
So as you can see, I have to avoid getting a message that refers to having no more elements in an enumeration.<br />
<br />
Any suggestions?</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/loops-control-statements/"><![CDATA[Loops & Control Statements]]></category>
			<dc:creator>SOG</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/loops-control-statements/29648-while-loop-supposed-replace-substring.html</guid>
		</item>
	</channel>
</rss>
