Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package com.spec;
- /**
- *
- * @author Admin
- */
- public class Main {
- //
- public static void main(String[] args) {
- // if-else
- int day = 12;
- String dayOFWeek;
- switch (day) {
- case 1:
- dayOFWeek = "MON";
- break;
- case 2:
- dayOFWeek = "TUE";
- break;
- case 3:
- dayOFWeek = "WED";
- break;
- default:
- dayOFWeek = "Invalid number";
- break;
- }
- System.out.println("dayOFWeek=" + dayOFWeek);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement