<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FLanguage_Basics%2FSwitch</id>
		<title>Java/Language Basics/Switch - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FLanguage_Basics%2FSwitch"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/Language_Basics/Switch&amp;action=history"/>
		<updated>2026-04-21T21:57:38Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/Language_Basics/Switch&amp;diff=7543&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/Language_Basics/Switch&amp;diff=7543&amp;oldid=prev"/>
				<updated>2010-06-01T06:47:52Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 06:47, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/Language_Basics/Switch&amp;diff=7542&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/Language_Basics/Switch&amp;diff=7542&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:45Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Demonstrates the switch statement. ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
//: c03:VowelsAndConsonants.java&lt;br /&gt;
// &lt;br /&gt;
// From &amp;quot;Thinking in Java, 3rd ed.&amp;quot; (c) Bruce Eckel 2002&lt;br /&gt;
// www.BruceEckel.ru. See copyright notice in CopyRight.txt.&lt;br /&gt;
public class VowelsAndConsonants {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    for(int i = 0; i &amp;lt; 100; i++) {&lt;br /&gt;
      char c = (char)(Math.random() * 26 + &amp;quot;a&amp;quot;);&lt;br /&gt;
      System.out.print(c + &amp;quot;: &amp;quot;);&lt;br /&gt;
      switch(c) {&lt;br /&gt;
        case &amp;quot;a&amp;quot;:&lt;br /&gt;
        case &amp;quot;e&amp;quot;:&lt;br /&gt;
        case &amp;quot;i&amp;quot;:&lt;br /&gt;
        case &amp;quot;o&amp;quot;:&lt;br /&gt;
        case &amp;quot;u&amp;quot;: System.out.println(&amp;quot;vowel&amp;quot;);&lt;br /&gt;
                  break;&lt;br /&gt;
        case &amp;quot;y&amp;quot;:&lt;br /&gt;
        case &amp;quot;w&amp;quot;: System.out.println(&amp;quot;Sometimes a vowel&amp;quot;);&lt;br /&gt;
                  break;&lt;br /&gt;
        default:  System.out.println(&amp;quot;consonant&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
} ///:~&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Free Flowing Switch Statement Example ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    int i = 0;&lt;br /&gt;
    switch (i) {&lt;br /&gt;
    case 0:&lt;br /&gt;
      System.out.println(&amp;quot;i is 0&amp;quot;);&lt;br /&gt;
    case 1:&lt;br /&gt;
      System.out.println(&amp;quot;i is 1&amp;quot;);&lt;br /&gt;
    case 2:&lt;br /&gt;
      System.out.println(&amp;quot;i is 2&amp;quot;);&lt;br /&gt;
    default:&lt;br /&gt;
      System.out.println(&amp;quot;Free flowing switch example!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
/*&lt;br /&gt;
i is 0&lt;br /&gt;
i is 1&lt;br /&gt;
i is 2&lt;br /&gt;
Free flowing switch example!&lt;br /&gt;
*/&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Nested Switch Statements Example ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    int i = 0;&lt;br /&gt;
    switch (i) {&lt;br /&gt;
    case 0:&lt;br /&gt;
      int j = 1;&lt;br /&gt;
      switch (j) {&lt;br /&gt;
      case 0:&lt;br /&gt;
        System.out.println(&amp;quot;i is 0, j is 0&amp;quot;);&lt;br /&gt;
        break;&lt;br /&gt;
      case 1:&lt;br /&gt;
        System.out.println(&amp;quot;i is 0, j is 1&amp;quot;);&lt;br /&gt;
        break;&lt;br /&gt;
      default:&lt;br /&gt;
        System.out.println(&amp;quot;nested default case!!&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      System.out.println(&amp;quot;No matching case found!!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
//i is 0, j is 1&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Switch Demo ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
/* From http://java.sun.ru/docs/books/tutorial/index.html */&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.&lt;br /&gt;
 *&lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without&lt;br /&gt;
 * modification, are permitted provided that the following conditions are met:&lt;br /&gt;
 *&lt;br /&gt;
 * -Redistribution of source code must retain the above copyright notice, this&lt;br /&gt;
 *  list of conditions and the following disclaimer.&lt;br /&gt;
 *&lt;br /&gt;
 * -Redistribution in binary form must reproduce the above copyright notice,&lt;br /&gt;
 *  this list of conditions and the following disclaimer in the documentation&lt;br /&gt;
 *  and/or other materials provided with the distribution.&lt;br /&gt;
 *&lt;br /&gt;
 * Neither the name of Sun Microsystems, Inc. or the names of contributors may&lt;br /&gt;
 * be used to endorse or promote products derived from this software without&lt;br /&gt;
 * specific prior written permission.&lt;br /&gt;
 *&lt;br /&gt;
 * This software is provided &amp;quot;AS IS,&amp;quot; without a warranty of any kind. ALL&lt;br /&gt;
 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING&lt;br /&gt;
 * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE&lt;br /&gt;
 * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. (&amp;quot;SUN&amp;quot;)&lt;br /&gt;
 * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE&lt;br /&gt;
 * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS&lt;br /&gt;
 * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST&lt;br /&gt;
 * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,&lt;br /&gt;
 * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY&lt;br /&gt;
 * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,&lt;br /&gt;
 * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.&lt;br /&gt;
 *&lt;br /&gt;
 * You acknowledge that this software is not designed, licensed or intended&lt;br /&gt;
 * for use in the design, construction, operation or maintenance of any&lt;br /&gt;
 * nuclear facility.&lt;br /&gt;
 */&lt;br /&gt;
public class SwitchDemo {&lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
        int month = 8;&lt;br /&gt;
        switch (month) {&lt;br /&gt;
            case 1:  System.out.println(&amp;quot;January&amp;quot;); break;&lt;br /&gt;
            case 2:  System.out.println(&amp;quot;February&amp;quot;); break;&lt;br /&gt;
            case 3:  System.out.println(&amp;quot;March&amp;quot;); break;&lt;br /&gt;
            case 4:  System.out.println(&amp;quot;April&amp;quot;); break;&lt;br /&gt;
            case 5:  System.out.println(&amp;quot;May&amp;quot;); break;&lt;br /&gt;
            case 6:  System.out.println(&amp;quot;June&amp;quot;); break;&lt;br /&gt;
            case 7:  System.out.println(&amp;quot;July&amp;quot;); break;&lt;br /&gt;
            case 8:  System.out.println(&amp;quot;August&amp;quot;); break;&lt;br /&gt;
            case 9:  System.out.println(&amp;quot;September&amp;quot;); break;&lt;br /&gt;
            case 10: System.out.println(&amp;quot;October&amp;quot;); break;&lt;br /&gt;
            case 11: System.out.println(&amp;quot;November&amp;quot;); break;&lt;br /&gt;
            case 12: System.out.println(&amp;quot;December&amp;quot;); break;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SwitchDemo 2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
/* From http://java.sun.ru/docs/books/tutorial/index.html */&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.&lt;br /&gt;
 *&lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without&lt;br /&gt;
 * modification, are permitted provided that the following conditions are met:&lt;br /&gt;
 *&lt;br /&gt;
 * -Redistribution of source code must retain the above copyright notice, this&lt;br /&gt;
 *  list of conditions and the following disclaimer.&lt;br /&gt;
 *&lt;br /&gt;
 * -Redistribution in binary form must reproduce the above copyright notice,&lt;br /&gt;
 *  this list of conditions and the following disclaimer in the documentation&lt;br /&gt;
 *  and/or other materials provided with the distribution.&lt;br /&gt;
 *&lt;br /&gt;
 * Neither the name of Sun Microsystems, Inc. or the names of contributors may&lt;br /&gt;
 * be used to endorse or promote products derived from this software without&lt;br /&gt;
 * specific prior written permission.&lt;br /&gt;
 *&lt;br /&gt;
 * This software is provided &amp;quot;AS IS,&amp;quot; without a warranty of any kind. ALL&lt;br /&gt;
 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING&lt;br /&gt;
 * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE&lt;br /&gt;
 * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. (&amp;quot;SUN&amp;quot;)&lt;br /&gt;
 * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE&lt;br /&gt;
 * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS&lt;br /&gt;
 * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST&lt;br /&gt;
 * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,&lt;br /&gt;
 * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY&lt;br /&gt;
 * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,&lt;br /&gt;
 * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.&lt;br /&gt;
 *&lt;br /&gt;
 * You acknowledge that this software is not designed, licensed or intended&lt;br /&gt;
 * for use in the design, construction, operation or maintenance of any&lt;br /&gt;
 * nuclear facility.&lt;br /&gt;
 */&lt;br /&gt;
public class SwitchDemo2 {&lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
        int month = 2;&lt;br /&gt;
        int year = 2000;&lt;br /&gt;
        int numDays = 0;&lt;br /&gt;
        switch (month) {&lt;br /&gt;
            case 1:&lt;br /&gt;
            case 3:&lt;br /&gt;
            case 5:&lt;br /&gt;
            case 7:&lt;br /&gt;
            case 8:&lt;br /&gt;
            case 10:&lt;br /&gt;
            case 12:&lt;br /&gt;
                numDays = 31;&lt;br /&gt;
                break;&lt;br /&gt;
            case 4:&lt;br /&gt;
            case 6:&lt;br /&gt;
            case 9:&lt;br /&gt;
            case 11:&lt;br /&gt;
                numDays = 30;&lt;br /&gt;
                break;&lt;br /&gt;
            case 2:&lt;br /&gt;
                if ( ((year % 4 == 0) &amp;amp;&amp;amp; !(year % 100 == 0))&lt;br /&gt;
                     || (year % 400 == 0) )&lt;br /&gt;
                    numDays = 29;&lt;br /&gt;
                else&lt;br /&gt;
                    numDays = 28;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
        System.out.println(&amp;quot;Number of Days = &amp;quot; + numDays);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Switch Demo 2: switch statement with different type of variable ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) Ian F. Darwin, http://www.darwinsys.ru/, 1996-2002.&lt;br /&gt;
 * All rights reserved. Software written by Ian F. Darwin and others.&lt;br /&gt;
 * $Id: LICENSE,v 1.8 2004/02/09 03:33:38 ian Exp $&lt;br /&gt;
 *&lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without&lt;br /&gt;
 * modification, are permitted provided that the following conditions&lt;br /&gt;
 * are met:&lt;br /&gt;
 * 1. Redistributions of source code must retain the above copyright&lt;br /&gt;
 *    notice, this list of conditions and the following disclaimer.&lt;br /&gt;
 * 2. Redistributions in binary form must reproduce the above copyright&lt;br /&gt;
 *    notice, this list of conditions and the following disclaimer in the&lt;br /&gt;
 *    documentation and/or other materials provided with the distribution.&lt;br /&gt;
 *&lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS&amp;quot;&amp;quot;&lt;br /&gt;
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED&lt;br /&gt;
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR&lt;br /&gt;
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS&lt;br /&gt;
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR&lt;br /&gt;
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF&lt;br /&gt;
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS&lt;br /&gt;
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN&lt;br /&gt;
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)&lt;br /&gt;
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE&lt;br /&gt;
 * POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
 * &lt;br /&gt;
 * Java, the Duke mascot, and all variants of Sun&amp;quot;s Java &amp;quot;steaming coffee&lt;br /&gt;
 * cup&amp;quot; logo are trademarks of Sun Microsystems. Sun&amp;quot;s, and James Gosling&amp;quot;s,&lt;br /&gt;
 * pioneering role in inventing and promulgating (and standardizing) the Java &lt;br /&gt;
 * language and environment is gratefully acknowledged.&lt;br /&gt;
 * &lt;br /&gt;
 * The pioneering role of Dennis Ritchie and Bjarne Stroustrup, of AT&amp;amp;T, for&lt;br /&gt;
 * inventing predecessor languages C and C++ is also gratefully acknowledged.&lt;br /&gt;
 */&lt;br /&gt;
public class Switch {&lt;br /&gt;
  static short s;&lt;br /&gt;
  static int   i;&lt;br /&gt;
  static long  L;&lt;br /&gt;
  public static void main(String[] args) { &lt;br /&gt;
    switch(s) {&lt;br /&gt;
      case 0: System.out.println(s);&lt;br /&gt;
    }&lt;br /&gt;
    switch(i) {&lt;br /&gt;
      case 0: System.out.println(i);&lt;br /&gt;
    }&lt;br /&gt;
    switch(L) {    // EXPECT COMPILER ERROR&lt;br /&gt;
      case 0: System.out.println(L);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Switch demo with empty case statement ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2000 David Flanagan.  All rights reserved.&lt;br /&gt;
 * This code is from the book Java Examples in a Nutshell, 2nd Edition.&lt;br /&gt;
 * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied.&lt;br /&gt;
 * You may study, use, and modify it for any non-commercial purpose.&lt;br /&gt;
 * You may distribute it non-commercially as long as you retain this notice.&lt;br /&gt;
 * For a commercial use license, or to purchase the book (recommended),&lt;br /&gt;
 * visit http://www.davidflanagan.ru/javaexamples2.&lt;br /&gt;
 */&lt;br /&gt;
/**&lt;br /&gt;
 * This class is much like the FizzBuzz class, but uses a switch statement&lt;br /&gt;
 * instead of repeated if/else statements&lt;br /&gt;
 */&lt;br /&gt;
public class FizzBuzz2 {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    for (int i = 1; i &amp;lt;= 100; i++) { // count from 1 to 100&lt;br /&gt;
      switch (i % 35) { // What&amp;quot;s the remainder when divided by 35?&lt;br /&gt;
      case 0: // For multiples of 35...&lt;br /&gt;
        System.out.print(&amp;quot;fizzbuzz &amp;quot;); // print &amp;quot;fizzbuzz&amp;quot;.&lt;br /&gt;
        break; // Don&amp;quot;t forget this statement!&lt;br /&gt;
      case 5:&lt;br /&gt;
      case 10:&lt;br /&gt;
      case 15: // If the remainder is any of these&lt;br /&gt;
      case 20:&lt;br /&gt;
      case 25:&lt;br /&gt;
      case 30: // then the number is a multiple of 5&lt;br /&gt;
        System.out.print(&amp;quot;fizz &amp;quot;); // so print &amp;quot;fizz&amp;quot;.&lt;br /&gt;
        break;&lt;br /&gt;
      case 7:&lt;br /&gt;
      case 14:&lt;br /&gt;
      case 21:&lt;br /&gt;
      case 28: // For any multiple of 7...&lt;br /&gt;
        System.out.print(&amp;quot;buzz &amp;quot;); // print &amp;quot;buzz&amp;quot;.&lt;br /&gt;
        break;&lt;br /&gt;
      default: // For any other number...&lt;br /&gt;
        System.out.print(i + &amp;quot; &amp;quot;); // print the number.&lt;br /&gt;
        break;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    System.out.println();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>