Advertisement
sergAccount

Untitled

Aug 30th, 2020
1,435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.spec;
  7.  
  8. /**
  9.  *
  10.  * @author Admin
  11.  */
  12. public class Main {
  13.  
  14.     //
  15.     public static void main(String[] args) {
  16.  
  17.         // if-else
  18.         int day = 12;
  19.         String dayOFWeek;
  20.         switch (day) {
  21.             case 1:
  22.                 dayOFWeek = "MON";
  23.                 break;
  24.             case 2:
  25.                 dayOFWeek = "TUE";
  26.                 break;
  27.             case 3:
  28.                 dayOFWeek = "WED";
  29.                 break;
  30.             default:
  31.                 dayOFWeek = "Invalid number";
  32.                 break;
  33.         }
  34.         System.out.println("dayOFWeek=" + dayOFWeek);
  35.  
  36.     }
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement