Démonstration de switch

Author:


{filelink=4614}


public class Switch {
  static short s;
  static int   i;
  static long  L;
  public static void main(String[] args) {
    switch(s) {
      case 0: System.out.println(s);
    }
    switch(i) {
      case 0: System.out.println(i);
    }
    switch(L) {    // S'attendre � une erreur de compilation
      case 0: System.out.println(L);
    }
  }
}

A Voir sur le même Sujet:

  • structure de controle en java

Leave a Reply

Your email address will not be published. Required fields are marked *