Switch、ハッシュデータによるデータ処理
- import java.util.Scanner;
-
-
- public class yuangongfenpei {
- public static void main(String[]args)
- {
- Scanner scanner = new Scanner(System.in);
- System.out.println(" ");
- String nameString = scanner.nextLine();
- System.out.println(" ");
- String languangeString = scanner.nextLine();
- switch (languangeString.hashCode()) {
- //Java
- case 3254818:
- case 2310506:
- case 2269730:
- System.out.println(" "+nameString+" Java 。");
- break;
- //C#
- case 3104:
- case 2112:
- System.out.println(" "+nameString+" C# ");
- break;
- //ASP.NET
- case -709190099:
- case 955463181:
- case 9745901:
- System.out.println(" "+nameString+" ASP.NET ");
- break;
- default:
- System.out.println(" "+languangeString+" ");
- }
-
- }
-
- }